Performance

Premature Optimization

Premature optimization is the root of all evil.

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

The Full Quote (Often Missed)

Knuth also said: Yet we should not pass up our opportunities in that critical 3%. The point is not to never optimize, but to:
  1. Profile first — identify actual bottlenecks
  2. Optimize the right 3% — focus on hot paths
  3. Don't sacrifice readability for marginal gains

Write clear code first, then measure, then optimize.

Resources

Open the interactive DevLaws app for protocols, bookmarks, and AI enforcement.

Open in app Browse all laws Marketing site