Performance Realities: Why Most Performance Optimisations Don't Matter
Introduction:
Performance optimisation is one of the most satisfying activities in software engineering. Finding an inefficient algorithm, replacing it with a better one, measuring the improvement, and watching response times drop is deeply rewarding. It feels like unambiguous progress — the system is objectively faster than it was before.
But most performance optimisations do not matter. Not because the improvements are not real, but because they are not improvements to the part of the system that is actually limiting performance. Engineers who optimise code that is not on the critical path, who reduce latency in components that are not bottlenecks, and who spend weeks achieving impressive percentage improvements on operations that represent a negligible fraction of total system time are producing results that users cannot feel and business metrics cannot detect.
Understanding why most performance optimisations do not matter is the prerequisite for finding the ones that do.
Amdahl's Law Defines the Ceiling:
Amdahl's Law states that the maximum speedup achievable by optimising a portion of a system is limited by the fraction of time that portion represents in the overall system execution. If a component accounts for ten percent of total execution time and you make it infinitely fast — reducing its contribution to zero — the overall system becomes at most eleven percent faster.
This ceiling is lower than most engineers intuitively expect. Teams that invest significant effort optimising a component that represents a small fraction of system time are operating in a region where the returns on engineering effort are fundamentally bounded by mathematics, not by the quality of their optimisation work.
The implication is that finding the right thing to optimise matters more than optimising well. An average optimisation applied to the dominant bottleneck produces more user-visible improvement than an excellent optimisation applied to a component that is not limiting performance.
Profiling Reveals What Intuition Gets Wrong:
Engineers are consistently wrong about where their systems spend time. The component that feels slow during development is often not the component that is slow in production. The database query that seems expensive is sometimes fast because of index coverage that is not obvious from reading the query. The network call that seems cheap accumulates into a significant fraction of request latency when called in a loop across thousands of records.
Intuition about performance is shaped by what is visible — slow compile times, slow test runs, slow manual interactions during development — rather than by what is actually consuming time in production under real load. These two things are frequently different enough that optimising based on intuition consistently produces improvements in the wrong places.
Profiling — measuring where time is actually spent rather than where it seems like time is spent — is the only reliable way to identify what to optimise. A profiler attached to a production workload consistently surfaces bottlenecks that are not visible during development and validates or invalidates assumptions about where optimisation effort should be directed.
Micro-Optimisations Rarely Survive Contact With the System:
Micro-optimisations — reducing the constant factor of an already efficient algorithm, eliminating unnecessary object allocations, replacing a slightly slower data structure with a slightly faster one — produce improvements that are real at the component level and invisible at the system level.
A function that is made five times faster but represents 0.1 percent of total request time contributes a 0.08 percent improvement to end-to-end latency. Users cannot perceive differences smaller than approximately 20 milliseconds in interactive applications. A 0.08 percent improvement on a 200 millisecond response time is 0.16 milliseconds — three orders of magnitude below the threshold of perception.
Micro-optimisations are not worthless. In tight loops that run millions of times, in hot paths that represent significant fractions of system time, and in systems with extremely tight latency budgets, they matter. In the vast majority of application code, they produce improvements that are measurable only in isolation and invisible in practice.
The Database Is Usually the Actual Bottleneck:
In most web applications and services, the dominant performance bottleneck is the database — specifically, queries that lack appropriate indexes, queries that return more data than is needed, and query patterns that make more round trips to the database than necessary. Application code that processes the results of these queries efficiently is optimising the wrong layer.
A query that performs a full table scan on a table with millions of rows because it lacks an index will take seconds regardless of how efficiently the application code processes the results. Adding the appropriate index can reduce the same query to milliseconds — an improvement that no amount of application-level optimisation could approach.
Teams that reach for application-level performance optimisation before exhausting database-level opportunities are choosing the harder path to a smaller improvement. Slow query logs, query execution plans, and database profiling tools consistently surface optimisation opportunities that produce order-of-magnitude improvements rather than the percentage improvements that application-level optimisation typically achieves.
Network Latency Dominates in Distributed Systems:
In distributed systems, network latency is frequently the dominant performance factor — more significant than computation time, memory access patterns, or algorithmic efficiency. A service that makes ten sequential network calls to downstream services accumulates their latencies regardless of how efficiently it processes the responses.
Reducing sequential network calls through parallelisation, eliminating unnecessary calls through caching, and reducing the volume of data transferred through pagination and field selection consistently produce larger improvements than optimising the computation that happens between network calls.
Engineers who optimise computation in systems where network latency dominates are improving the part of the system that is not the bottleneck. The optimisation is real but the system does not get meaningfully faster because network time, which was not optimised, still dominates end-to-end latency.
Premature Optimisation Introduces Complexity That Outlasts Its Benefit:
Optimisations that are applied before the performance problem they address is confirmed in production introduce complexity that is difficult to justify and harder to remove. Code that has been optimised for performance is frequently harder to read, harder to modify, and harder to debug than unoptimised code that achieves the same result.
When the optimisation turns out to be in the wrong place — which, given how consistently engineers misidentify bottlenecks without profiling, is a common outcome — the complexity remains long after the optimisation effort has been forgotten. The codebase carries the maintenance burden of an optimisation that never improved user-visible performance.
Deferring optimisation until a specific, measured performance problem has been identified in production eliminates this category of waste. Systems that are built for clarity first and optimised for performance only where measurement confirms a bottleneck are faster to develop, easier to maintain, and ultimately no slower in production than systems that were optimised prematurely.
Conclusion:
Most performance optimisations do not matter because they are applied to the wrong part of the system, at the wrong level of abstraction, before measurement has confirmed that the optimised component is actually limiting performance. The engineering effort is real, the improvements are real, and the user-visible impact is negligible.
The performance optimisations that matter are the ones that address confirmed bottlenecks — identified through profiling rather than intuition, located at the layer where time is actually being spent, and evaluated against the ceiling that Amdahl's Law places on the improvement any single optimisation can achieve. Finding those optimisations requires measurement discipline that is less satisfying than optimisation itself but more reliably produces results that users can actually feel.
Enjoyed this post?
Stay in the loop
New posts + weekly digest, straight to your inbox.
Create a free account
- Save posts to your vault
- Like posts & build history
- New-post alerts
No comments yet. Be the first to comment!