sernaferna: Beautiful Code: False Optimizations
From the post: One of the first concepts that jumped out at me from Beautiful Code concerned false optimizations—that is, something added to the code which should have been an optimization, but as it turns out, actually causes the code to run slower.
This is a great post. The first example shows that while doing a search, it ended up being faster just to let the search run through all the items instead of checking each time if the search found the correct item. Checking each time ends up being slower, even though that’s the intuitive thing to do. It’s things like this that help me understand how far I have to come as a programmer. Great stuff.
Short URL for this post: http://tmblr.co/ZhCfay2a7BU