NAPKIN MATH

latency numbers every dev should know

Which is faster?

Pick the operation with the lower latency. Order-of-magnitude intuition is what makes you good at systems thinking.
0 / 0
score
0
streak
Loading…

The Numbers

Bars are on a logarithmic scale. If they were linear, the cache reads would be invisible specks. Sourced from the classic Jeff Dean / Peter Norvig "Numbers Everyone Should Know" list, with 2020s-era updates.
Why this matters: when you're estimating cost, throughput, or "should I cache this?", you don't need exact numbers — you need to know which side of which line you're on. Network > disk > memory > cache. Each step is roughly 100× the one above it. Build the intuition once, use it forever.

If an L1 cache hit took 1 second…

Latency numbers are abstract. Scaling them so an L1 hit = 1 second makes them feelable. Below, every operation is rescaled to that human clock.

Memory hierarchy in human time

An L1 cache reference (~0.5 ns) is your baseline second. Watch how fast you fall off a cliff.

The takeaway

A cross-continent network round trip, on this scale, takes almost ten years. That's why a chatty API is so painful. That's why batching exists. That's why edge caching is worth the operational complexity. Everything in distributed systems is a fight against the speed of light, and the speed of light is, in human terms, almost a decade per round trip.