[om-list] When not to optimize

Mark Butler butlerm at middle.net
Sat Mar 9 22:20:05 EST 2002


Hello everyone,

Here is an excerpt of a very interesting article on optimization:

Optimization: Your Worst Enemy 
by Joseph M. Newcomer
[http://www.pgh.net/~newcomer/optimization.htm]
 
"Now there's a title to grab your attention! But I'm serious!" ...

"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." ....

[Rest of article at http://www.pgh.net/~newcomer/optimization.htm]


***




More information about the om-list mailing list