Against the Cult of Performance

Always dealing with optimized code of incredibly slow and buggy applications…

Some of my favorite quotes against premature optimization following.

More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason — including blind stupidity.
— William A. Wulf

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.
— Donald E. Knuth

We follow two rules in the matter of optimization: Rule 1. Don’t do it. Rule 2 (for experts only). Don’t do it yet — that is, not until you have a perfectly clear and unoptimized solution.
— M. A. Jackson

Make it Run, Make it Right, Make it Fast
— Kent Beck

Make it work, make it correct, make it fast, make it cheap.
— (attributed to) Alan Kay

The best code is no code
— Roml Lefkowitz

The best is the enemy of the good.
— Voltaire

It is easier to optimize correct code than to correct optimized code. Premature optimization is counterproductive and in the long run actually hinders optimization. Unnecessary optimization will distort designs, destroy modularity and information-hiding, and make code much harder to modify. Latent bugs will take longer to find. We often discover by profiling, or by changing machines or compilers, that we misjudged the computational effort of our code. Guess what? Optimization is going to be much harder than it had to be.
— Bill Harlan


3 Responses to “Against the Cult of Performance”  

  1. 1 uberto

    I’m wondering why you posted this! ;)

  2. 2 Luigi

    Uberto [see note], you know: we have an application that is very optimized (it has dozen of caches everywhere, and pools of pools of pools, and so on…). The result is that to run that you need 4GB of memory and a supercomputer, and has so many bugs and no one is able to understand it. And, it is still slow!

    When our client fired all the developers that implemented this, was like opening the Pandora’s jar: imagine all those people now, they are doing disasters all over the world. The End Of World is next. :-)

    Also I posted here all those quotes, because next time somebody will ask me to cache something or to implement some optimization weirdness I will answer with all those quotes (and then implement the stuff as requested, as I don’t write code for my pleasure)

    note: Uberto is my coworker, and we are working on the same very “optimized” code base.

  3. 3 uberto

    And the nice part is that we have this generally mis-optimized application with some specific highly critical part completely unoptimized, like the request management. Exactly the opposite of what a good design is.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



Calendar

March 2008
M T W T F S S
« Oct   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:

Archives


Categories

Tag Cloud


Listening