Column
Making it faster
When something is too slow, the first instinct is to speed up the part you know. This column reads from finding where the time actually goes, to the limits on any speedup, to why waiting grows, and then to what keeps speed over time.
It often starts with a part someone already suspects.
Premature Optimization
Optimizing before measuring spends effort on code that isn't the bottleneck.Keep in mind: Tune only what you measured; decide early only what you cannot tune laterMeasuring turns up many slow steps. When the work passes through them in a chain, only one of them sets how much gets through.
Theory of Constraints
A system's throughput is set by its single tightest bottleneck.Keep in mind: Improve the bottleneck first, because everything else is waiting on itEven after finding the bottleneck, how much a fix can help depends on how much of the total it is.
Amdahl's Law
Speeding up one part of a system barely helps when the bottleneck is somewhere else.Keep in mind: Find the bottleneck before you speed anything upAmdahl counts the time spent doing the work. In a busy system the bigger share can be time spent before the work starts, waiting for it.
Little's Law
In a stable system, the average number of items inside equals arrival rate times average time spent.Keep in mind: To finish faster, start lessLittle's Law ties waiting to the length of the line. What makes the line long is the next question.
Kingman's Formula
As a server's utilization approaches 100%, the time work spends waiting for it climbs steeply, and variability in arrivals and service multiplies the climb.Keep in mind: Keep headroom wherever someone is waiting on the answerA request that touches many servers is likely to meet some node's queue or stall, and the user waits for the slowest.
The Tail at Scale
When one request fans out to many servers, the slowest one sets the response time.Keep in mind: In a fan-out, watch the tail, not the averageThe usual cures for the tail, hedging and retrying, add work, and work that grows exactly when things go wrong is a slowdown of its own.
Constant Work
A system whose work grows with the number of changes or failures does the most work exactly when it has the least headroom.Keep in mind: In control loops, do the same work whether or not anything changedMost fixes so far are one-offs. Speed won once does not stay won unless something defends it.
Wirth's Law
Software gets slower faster than hardware gets faster.Keep in mind: Treat faster hardware as a budget to protect, not to spend




