Premature Optimization

Posted on Oct 14, 2024

Donald Knuth’s famous quote, “Premature optimization is the root of all evil.” is sometimes misunderstood and used as an excuse to avoid performance improvements early on. This can lead to bigger problems later when optimizations become much harder to implement because parts of the product may need to be rewritten or redesigned.

I’m writing this as a reference so I can link to it in the future when the quote is misused to dismiss valid performance concerns early in the design process.

“A 12% improvement, easily achieved, is never considered marginal…
…We should ignore small optimizations about 97% of the time; premature optimization is the root of all evil.”

“In my experience, for most critical systems, you do need to consider efficiency right from the beginning of the design process.”


Relevant Links:

Donald Knuth and Lex Fridman - Premature optimization is the root of all evil