O'Reilly logo

Art of Unix Programming, The by Eric Steven Raymond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12. Optimization

Premature optimization is the root of all evil.

—C. A. R. Hoare

This is going to be a very short chapter, because the main thing Unix experience teaches us about optimizing for performance is how to know when not to do it. A secondary lesson is that the most effective optimization tactics are usually things we do for other reasons, such as cleanness of design.

12.1 Don’t Just Do Something, Stand There!

The most powerful optimization technique in any programmer’s toolbox is to do nothing.

This very Zen advice is true for several reasons. One is the exponential effect of Moore’s Law—the smartest, cheapest, and often fastest way to collect performance gains is to wait a few months for your target hardware to become more capable. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required