Loading…
The reference table popularized by Jeff Dean and Peter Norvig at Google, updated for modern hardware — on a log scale, with a humanized column that makes each gap visceral. The bars below are logarithmic: every step to the right is another order of magnitude.
| Operation | Time | Log scale | If 1 ns were 1 second |
|---|---|---|---|
| L1 cache referenceThe baseline. Everything below is measured against this. | 1 ns | 1 second | |
| Branch mispredictWhy tight inner loops avoid unpredictable branches. | 3 ns | 3 seconds | |
| L2 cache referenceRoughly 4x slower than L1, still on-die. | 4 ns | 4 seconds | |
| Mutex lock/unlockUncontended. Contention makes this far worse. | 17 ns | 17 seconds |
| Operation | Time | Log scale | If 1 ns were 1 second |
|---|---|---|---|
| Main memory reference100x an L1 hit — the reason cache locality matters. | 100 ns | ~1.5 minutes | |
| Compress 1 KB with SnappyCompression is cheap relative to network and disk. Usually worth it. | 2 µs | ~33 minutes | |
| Read 1 MB sequentially from memorySequential RAM scans are fast — favor batch reads. | 10 µs | ~3 hours |
| Operation | Time | Log scale | If 1 ns were 1 second |
|---|---|---|---|
| SSD random read (4 KB)160x a RAM reference. In-memory caches exist because of this gap. | 16 µs | ~4.5 hours | |
| Read 1 MB sequentially from SSD20x slower than the same read from memory. | 200 µs | ~2.3 days | |
| Disk seek (spinning disk)Why databases avoid random I/O and love append-only logs. | 2 ms | ~23 days | |
| Read 1 MB sequentially from disk200x the same read from memory; 10x from SSD. | 2 ms | ~23 days |
| Operation | Time | Log scale | If 1 ns were 1 second |
|---|---|---|---|
| Round trip within same datacenterEvery microservice hop pays this. Chatty APIs multiply it. | 500 µs | ~5.8 days | |
| Read 1 MB over a 1 Gbps networkMoving data between machines dwarfs local work — ship compute to data. | 10 ms | ~4 months | |
| Round trip CA to Netherlands to CACross-region latency is physics (speed of light). CDNs and replicas exist because of this row. | 150 ms | ~4.8 years |
Interviewers do not quiz the table — they check whether your design decisions respect the ratios. Four patterns cover most conversations.
Each storage tier is roughly two orders of magnitude slower than the one above it: memory reference ~100ns, SSD random read ~16µs, same-datacenter RPC ~500µs. When your design adds a network hop to fetch something that could be cached in memory, you are paying ~5,000x. That single ratio justifies most caching decisions in an interview.
A same-datacenter round trip is ~500µs. A request that makes 20 sequential internal calls spends 10ms on network alone — before databases do any work. This is the number behind batching, request collapsing, and GraphQL-style aggregation layers.
At ~150ms per cross-continent round trip, you cannot hide inter-region calls inside an interactive request. Anything user-facing must be served from the user's region — which is exactly why CDNs, regional replicas, and eventual consistency exist. Say this arithmetic out loud in interviews.
Reading 1MB sequentially from disk (~2ms) costs about the same as a single seek (~2ms). That equivalence is why databases use append-only logs (WALs), why Kafka is fast, and why LSM-tree stores batch writes. If your design does random I/O on spinning disks, the numbers will call you out.
A table of reference latencies popularized by Jeff Dean and Peter Norvig at Google: an L1 cache reference takes about 1 nanosecond, a main memory reference about 100 nanoseconds, an SSD random read about 16 microseconds, a round trip inside a datacenter about 500 microseconds, and a cross-continent round trip about 150 milliseconds. The exact values shift with hardware generations; the ratios between them are what matter.
Use them to justify architecture decisions with arithmetic. Example: if a page load fans out to 5 sequential service calls inside one datacenter, that is 5 x 0.5ms = 2.5ms before any work happens — acceptable. If those calls cross regions at 150ms each, the same design costs 750ms — now you need regional replicas or request collapsing. Interviewers reward designs whose numbers are checked, not guessed.
Nanoseconds are impossible to feel, so the column stretches time by a factor of one billion: if an L1 cache hit took 1 second, a main memory reference would take about 1.5 minutes, an SSD read hours, a disk seek 23 days, and a cross-continent round trip almost 5 years. The scale makes it obvious why caching layers exist at every level.
Pair this table with the back-of-the-envelope calculator, then apply both inside real interactive system design questions.