Finding When Premature Optimization Is Evil

This article is based on the Software Mistakes and Tradeoffs book by Tomasz Lelek and Jon Skeet.

There is an old computer science saying that Premature Optimization is the root of all evil. The saying has stuck around because it’s accurate for a lot of use cases. Without any input data about expected traffic and SLA, it’s hard to reason about your code and its required performance. Optimizing random paths in code in such a situation is like shooting in the dark. You will complicate your code for no good reason.