25 March 2006

Optimization: Your Worst Enemy

Posted by Mikhail Esteves under: Tips .

Optimization: Your Worst Enemy

A reasonably skilled programmer will not write a grossly inefficient program. At least not deliberately. Optimization is what you do when the performance is insufficient. Sometimes the optimizations are easy, sometimes they are hard. Sometimes they fly in the face of your original design, and sometimes they require that you grossly violate your beautiful abstractions in your class system. But always, and I repeat, always, my experience has been that no programmer has ever been able to predict or analyze where performance bottlenecks are without data. No matter where you think the time is going, you will be surprised to discover that it is going somewhere else.

You optimize because you have a problem in performance. Sometimes it is computational optimization: your bitmap manipulation is just too slow. Sometimes it is data access optimization: it just takes too long to get the data into the machine. And sometimes it is algorithmic optimization: you’re doing it wrong. If you don’t understand the difference between an n2 sort and an n log n sort, you’re probably already in trouble, but that knowledge alone is not useful.

Read the rest here



Leave a Reply

Browse

Photography

Projects

Pages

Calendar

March 2006
M T W T F S S
« Feb   Apr »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

www.flickr.com

Use OpenDNS