Computers · performance

Latency Ladder

Eight orders of magnitude between a cache hit and a packet across an ocean. Stretch the clock until one nanosecond is one second and the gaps stop being exponents.
one nanosecond = one second

Compare

The whole ladder

A logarithmic axis, because a linear one would draw everything below a disk seek as a flat line on the floor. Each gridline is a factor of a thousand — the ladder covers nearly nine orders of magnitude from a CPU cycle to Amsterdam.

The rule’s own three rungs

at the figures it states

When the ladder stops applying

The ladder ranks latency — the cost of asking. Once you ask for enough at once, you are paying for the transfer instead, and the ranking collapses. Drag the slider and watch three media that differ by a factor of five hundred at 4 KB end up within a factor of twenty.

The thing that surprises people

The “×100” in the name is wrong about one of its own two rungs

The rule is usually stated as three numbers: RAM around 100 ns, an SSD around 100 µs, a spinning disk around 10 ms, each rung roughly a hundred times slower than the last. Two of those numbers are fine. The word “each” is not.

100 ns to 100 µs is a factor of a thousand. 100 µs to 10 ms is a factor of a hundred. So the ladder the mnemonic names goes up by 1000 and then by 100, and calling both of them “×100” understates the first gap by an order of magnitude — which is the gap that matters most, because it is the one between the thing your program does constantly and the thing it should be avoiding.

The useful version of the rule is not a constant. It is: memory to disk is 100,000×, and everything in systems design follows from that one number. Five orders of magnitude is why caches exist, why a database index is worth the write cost, and why an unexpected disk read in a hot loop does not slow a program down — it stops it.

Why the human clock helps

Nobody has intuition for a nanosecond, and everybody has intuition for a year

Take one nanosecond and call it one second. Every figure on this page multiplies by the same billion, so every ratio survives exactly — and the ladder turns into something a person can hold:

A cache hit is one second. A memory read becomes 100.0 seconds — under two minutes, a pause. A SATA SSD read becomes 41.7 hours: you asked a question on Monday morning and got the answer on Tuesday night. A disk seek becomes 3.8 months. And a packet to Amsterdam and back becomes 4.8 years — you would have started a degree.

That is the whole content of the rule, in a form nobody argues with. The reason a network call inside a loop is a different kind of mistake from a slow function is not that it is slower. It is that it is a different unit of time, and the loop was written by someone thinking in seconds.

And the rule’s own counterexample has expired

The Rulebook entry notes that a spinning disk streaming sequentially can beat an SSD serving random 4 KB reads — and against a SATA SSD it comfortably does, by about seven times. Against a modern NVMe drive it no longer does: 4 KB random reads land at roughly 205 MB/s against a disk’s 200 MB/s of streaming, which is a tie rather than a win. The example was true when it was written and is now a period piece, which is a fair description of most performance advice.

Field notes

Reading the ladder

Version history · site-wide passes only

This page has changed in 2 archived releases, but each of those was a site-wide pass, so none is attributable to this tool on its own and none is listed here. That is not a claim that the tool never changed — a release that reworked many pages at once may well have altered this one too. The changelog has them.

Every rung is an order of magnitude, not a measurement. Nothing here is good to better than a factor of two, because no such figure exists for “an SSD” in general — the ratios are the point, not the values. Queue depth and caching are not modelled, and both routinely matter more than the medium. See Sources.