UtilDojo

Popular

Menu

Latency Numbers Every Programmer Should Know, Scaled to Human Time

  • This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.

If this took…

s

Every other latency number is stretched by the same factor, so the ratios stay honest: a main memory reference is 200× an L1 hit whether that hit takes half a nanosecond or a second.

Scaled latencies

Latency numbers scaled so that L1 cache reference takes 1 s
OperationActual× slowerScaled
L1 cache reference
0.5 ns1×1 s
Branch mispredict
5 ns10×10 s
L2 cache reference
7 ns14×14 s
Mutex lock / unlock
25 ns50×50 s
Main memory reference
100 ns200×3.3 min
Compress 1 KB with Snappy
3 µs6K×1.7 h
Send 1 KB over 1 Gbps network
10 µs20K×5.6 h
Read 4 KB randomly from SSD
150 µs300K×3.5 days
Read 1 MB sequentially from memory
250 µs500K×5.8 days
Round trip within the same datacenter
500 µs1M×11.6 days
Read 1 MB sequentially from SSD
1 ms2M×23.1 days
Disk seek
10 ms20M×231.5 days
Read 1 MB sequentially from disk
20 ms40M×1.3 years
Send packet California → Netherlands → California
150 ms300M×9.5 years

About this tool

The “latency numbers every programmer should know” are a short list, first circulated by Jeff Dean and Peter Norvig, of how long the basic operations in a computer take: an L1 cache hit, a main memory read, a round trip inside a datacenter, a disk seek, a packet across an ocean. The raw numbers span nine orders of magnitude, from half a nanosecond to a sixth of a second, and that range is exactly why they are hard to feel. This page rescales them. Choose any operation and say it took one second (or any time you like); every other row is stretched by the same factor, so you can read the table in minutes, days and years instead of nanoseconds.

With the default setting, an L1 cache hit is one second. A main memory read then takes about 3 minutes, a 4 KB read from an SSD takes 3.5 days, a round trip within the datacenter takes 11.5 days, a single disk seek takes 7.6 months, and a packet from California to the Netherlands and back takes 9.5 years. Those ratios, not the absolute values, are what matter in a design review: they explain why a cache miss that falls through to disk is catastrophic, why batching network calls matters more than shaving CPU, and why a system that makes one database round trip per item in a loop cannot be fast however good the code is.

The presets jump to other viewpoints. Set memory = 1 s to feel the gap between RAM and storage: the SSD read becomes 25 minutes and the disk seek becomes 28 hours. Set SSD read = 1 s to compare storage with the network: the datacenter round trip is 3.3 seconds, the cross-ocean packet is 17 minutes. Each row shows the actual time, the ratio to your chosen base and the scaled human time, with a bar on a log scale so the ladder is visible at a glance. Copy as Markdown drops the scaled table into a design doc or interview notes.

The figures are the widely quoted 2012-era values, which are still the ones interviewers expect. Real hardware varies: NVMe drives read 4 KB in tens of microseconds rather than 150, and intercontinental round trips depend on the route, so treat every row as a typical order of magnitude. For the raw table in nanoseconds, plus powers of two and availability nines, see the Back-of-the-Envelope Calculator, which uses the same data to turn users into requests per second and storage.

If an L1 cache hit took one second
OperationActual timeScaled time
L1 cache reference0.5 ns1 s
Branch mispredict5 ns10 s
L2 cache reference7 ns14 s
Mutex lock / unlock25 ns50 s
Main memory reference100 ns3.3 min
Compress 1 KB with Snappy3 µs1.7 h
Send 1 KB over 1 Gbps network10 µs5.6 h
Read 4 KB randomly from SSD150 µs3.5 days
Read 1 MB sequentially from memory250 µs5.8 days
Round trip within the same datacenter500 µs11.6 days
Read 1 MB sequentially from SSD1 ms23.1 days
Disk seek10 ms231.5 days
Read 1 MB sequentially from disk20 ms1.3 years
Send packet California → Netherlands → California150 ms9.5 years

Frequently asked questions

Where do these latency numbers come from?

From a slide by Jeff Dean of Google, extended by Peter Norvig and later republished widely as “Latency numbers every programmer should know”. The values are typical figures for a server of around 2012 and are still the reference set used in system design interviews.

Are the numbers still accurate today?

The ratios are. Absolute figures have moved: an NVMe SSD reads 4 KB in roughly 20 to 100 microseconds rather than 150, memory latency is a little lower, and network hardware is faster. Spinning-disk seeks and the speed of light across an ocean have not changed, which is why the storage and network rows still dominate.

Why scale to human time at all?

Because nobody can feel the difference between 100 nanoseconds and 10 milliseconds, but everyone can feel the difference between 3 minutes and 7 months. The scaled view makes the cost of a cache miss or a synchronous network call obvious, which is the point of knowing the numbers.

What is the single most useful ratio to remember?

Memory to disk: a main memory read is about 100 nanoseconds and a disk seek about 10 milliseconds, a factor of 100,000. Close behind is memory to network: a datacenter round trip is roughly 5,000 memory reads. Both say the same thing: keep hot data in memory and batch everything that crosses a wire.

How do I use this in an interview?

Quote the ratio that matters for the design you are discussing. “A datacenter round trip is about half a millisecond, so one call per item over 10,000 items is five seconds; we need a batch endpoint.” Pair it with the Back-of-the-Envelope Calculator to attach request rates and storage to the same reasoning.

Related tools