Skip to content

The Most Expensive Optimization Is The One You Didn't Need

Premature optimization costs twice — the engineering time spent, and the complexity left behind. How to tell which optimizations are worth the trade.

By 1 min read
  • Production Lessons
  • Performance
  • Software Architecture
  • System Design

One thing I've learned over the years is that engineers love solving difficult problems. Sometimes a little too much.

A page loads in 800ms. Someone suggests introducing Redis. Another proposes Kafka. Someone else recommends breaking the service into microservices.

All before answering one simple question: Where is the actual bottleneck?

The Most Expensive Optimization Is The One You Didn't Need

I've seen teams spend weeks optimizing parts of the system that contributed only a few milliseconds to the total response time. Meanwhile, the real issue was a slow database query. Or a missing index. Or five sequential API calls. Or simply fetching far more data than the client needed.

The lesson wasn't that caching, queues, or microservices are bad. They're incredibly powerful.

But only when they're solving the right problem. One mindset that has saved me from unnecessary complexity is this: Measure first. Optimize second.

Architecture should remove bottlenecks. Not introduce new ones.

The best optimization isn't always the most impressive one. Sometimes it's deleting unnecessary work instead of adding new technology.

Keep reading