Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path
Latency Numbers Explorer
An interactive version of the classic "latency numbers every programmer should know." Compare the real time of an L1 cache reference, a memory read, an SSD read, a same-datacenter round trip and a cross-continent round trip — then scale them all to human time (where one CPU cycle is a second) to feel just how enormous the gaps really are.
- L1 cache reference0.5 ns
- Branch mispredict3 ns
- L2 cache reference4 ns
- Mutex lock / unlock17 ns
- Main memory reference100 ns
- Read 1 MB sequentially from memory3.0 µs
- SSD random read16 µs
- Read 1 MB from SSD49 µs
- Round trip within same datacenter500 µs
- Disk seek (HDD)3.0 ms
- Read 1 MB from disk (HDD)5.0 ms
- Round trip CA ↔ Netherlands150 ms
Order-of-magnitude figures — last reviewed 2026-07. Switch to human scale and a same-datacenter round trip becomes about a week, a cross-continent one years — the gaps that justify caching, locality and avoiding network hops.
Everyone agrees memory is fast and the network is slow, but the real gaps are far more extreme than intuition suggests. The twelve operations in this table span more than eight orders of magnitude, from half a nanosecond to 150 milliseconds. This explorer shows each one in real time, then stretches them all into human time so the distances become something you can feel.
What it computes
Each row is a fixed reference value in nanoseconds. Three things are derived from it:
real time = ns shown in ns, µs, ms or s, whichever fits
human time = ns read as seconds 1 ns → 1 s
bar width = (log₁₀(ns) − log₁₀(0.5)) / (log₁₀(150,000,000) − log₁₀(0.5))
- The human scale multiplies everything by one billion, so durations print as seconds, minutes, hours, days or years.
- The bars are logarithmic: the fastest operation, an L1 hit, is an empty bar and the slowest, the cross-continent trip, is full. Each equal step along the bar is the same multiplication factor, about 10× per 12% of the width.
A worked example
Here is the whole table as the tool renders it:
| Operation | Real time | Human scale | Bar |
|---|---|---|---|
| L1 cache reference | 0.5 ns | 0.5 sec | 0% |
| Branch mispredict | 3 ns | 3.0 sec | 9% |
| L2 cache reference | 4 ns | 4.0 sec | 11% |
| Mutex lock / unlock | 17 ns | 17 sec | 18% |
| Main memory reference | 100 ns | 1.7 min | 27% |
| Read 1 MB sequentially from memory | 3.0 µs | 50.0 min | 45% |
| SSD random read | 16 µs | 4.4 hours | 53% |
| Read 1 MB from SSD | 49 µs | 13.6 hours | 59% |
| Round trip within same datacenter | 500 µs | 5.8 days | 71% |
| Disk seek (HDD) | 3.0 ms | 34.7 days | 80% |
| Read 1 MB from disk (HDD) | 5.0 ms | 57.9 days | 83% |
| Round trip CA ↔ Netherlands | 150 ms | 4.8 years | 100% |
Read it as ratios. Main memory is 100 / 0.5 = 200× an L1 hit. A datacenter round trip is 500,000 / 100 = 5,000× a memory reference. Reading 1 MB from SSD is about 16× slower than from memory, and from a spinning disk about 100× slower than from SSD. The cross-continent trip is 300× a datacenter round trip.
Assumptions and limits
- Representative, not measured. The values are fixed order-of-magnitude references, last reviewed in July 2026, not benchmarks of your machine.
- Single operations. Real workloads overlap work: CPUs prefetch, SSDs serve many requests in parallel and networks pipeline, so throughput can be far better than one latency suggests.
- Unloaded systems. Queues add delay. A disk or network link near saturation can be many times slower than its idle latency, and tail latency is worse still.
- One geography. The long-haul figure is one route; other paths are shorter or longer.
How to use the result
- Count the hops. A request that makes ten sequential same-datacenter calls spends about 5 ms on round trips alone, before any work.
- Keep hot data close. Every level you avoid, network to memory or disk to memory, saves orders of magnitude, which is why caches pay for themselves.
- Batch and parallelize remote calls. Ten calls in parallel cost one round trip, not ten.
- Put users near servers. No code change removes 150 ms of distance; replicas and edge caches do.
When to use it, and when not
Use these numbers for back-of-envelope design: whether a cache is worth it, whether a request can afford another hop, whether a latency target is physically possible. A 100 ms page budget for a user in the Netherlands served from California cannot be met, because one round trip is 150 ms. They are also the shared vocabulary of design interviews, where the ratios matter more than the digits.
Do not use them as an SLA, a capacity plan or a hardware comparison. Those need measured percentiles from your own machines under realistic load: the table describes one operation on an idle system, and production latency is set by queues, contention and the slowest of many parallel calls.
Trade-offs and limits
A latency is not a throughput. An SSD random read takes 16 µs, so one thread issuing reads one at a time gets 1,000,000,000 / 16,000 = 62,500 a second, but an SSD serves many requests at once and the device can do far more. A spinning disk is the opposite case: a 3 ms seek caps it near 333 random reads a second however many you queue, because the head can only be in one place.
| What the single number hides | Effect in practice |
|---|---|
| Connection setup | A new HTTPS connection costs extra round trips before the first response |
| Queueing under load | Latency climbs steeply as a resource nears saturation |
| Parallel fan-out | The slowest of N calls sets the response time |
| Hardware generation | Absolute values drift; ratios between levels hold better |
Connection setup is the one most often missed. TCP needs one round trip to connect and TLS 1.3 one more to agree keys before the request and response take a third. On the California to Netherlands route that is 3 × 150 = 450 ms, 14.3 years on the human scale, which is why reusing connections matters more for distant users than almost any server-side speed-up.
Common mistakes
- Queries in a loop. Fetching a list and then each item separately, the N+1 pattern, turns one page into 101 sequential round trips:
101 × 0.5 ms = 50.5 msinside one datacenter, before the database does any work. - Averaging across a cache. Effective latency is
hit rate × hit time + miss rate × miss time, and the miss term dominates. A 90% hit rate in front of a 500 µs miss averages about 50 µs, 500 times the 100 ns hit. - Treating an SSD like memory. A random SSD read is 160 times a main memory reference. Data paged out to fast local storage still pays that on every access.
- Ignoring the tail in fan-out. If each of 100 parallel calls is slow 1% of the time, at least one is slow on
1 − 0.99¹⁰⁰ = 63%of requests. A one-in-a-hundred event at each backend becomes the usual case for the whole request. - Confusing µs and ms. A factor of a thousand is easy to drop in a design doc. Write the unit on every figure and check it against the table.
Check yourself
A page runs 1 query for a list of 100 items, then 1 query per item, all in the same datacenter. How long goes on round trips, and what does batching save?
101 sequential round trips at 500 µs each is 50.5 ms. Fetching every item in one batched query makes it 2 round trips, 1 ms: a 50× cut without touching the database.
A memory cache (100 ns) fronts a service one datacenter round trip away (500 µs). What is the average latency at a 90% and a 99% hit rate?
At 90%: 0.9 × 100 + 0.1 × 500,000 = 50,090 ns, about 50 µs. At 99%: 0.99 × 100 + 0.01 × 500,000 = 5,099 ns, about 5.1 µs. Nine more points of hit rate make the average ten times faster, because nearly all the time is in the misses.
A user in the Netherlands opens a fresh HTTPS connection (TCP plus TLS 1.3) to a server in California and makes one request. What is the least time to the response?
Three round trips: connect, key agreement, then request and response, so 3 × 150 ms = 450 ms before the server does any work. On a reused connection it is one round trip, 150 ms; only a nearer server shortens the round trip itself.
A job does 1 million random reads, one at a time. How long on a hard disk (3 ms per seek) and on an SSD (16 µs per read)?
Hard disk: 1,000,000 × 3 ms = 3,000 s, 50 minutes. SSD: 1,000,000 × 16 µs = 16 s. The ratio is 187.5×, which is why random-access workloads moved to SSDs, while sequential reads, 1 MB in 5 ms, keep spinning disks useful for bulk storage.
How it works
- Real times: L1/L2, memory, SSD, HDD, datacenter and cross-continent RTT.
- One-click scale to human time, where 1 nanosecond becomes 1 second.
- Log-scaled bars make the orders-of-magnitude gaps visible.
- The intuition behind caching, locality and avoiding hops.
Frequently asked questions
What are "the latency numbers every programmer should know"?
A widely shared table of approximate timings for common operations, popularized by Jeff Dean and Peter Norvig and updated by others since. In the version used here, an L1 cache reference is 0.5 ns, main memory 100 ns, an SSD random read 16 µs, a round trip inside one datacenter 500 µs, a hard-disk seek 3 ms and a round trip from California to the Netherlands 150 ms. Knowing their relative scale is what lets engineers reason about where time actually goes.
Why scale them to human time?
Because nanoseconds and milliseconds both register as simply small, which hides the enormous gaps between them. The human-scale view stretches every figure so that 1 nanosecond becomes 1 second. Then a main memory reference takes 1.7 minutes, an SSD random read 4.4 hours, a same-datacenter round trip 5.8 days and a cross-continent round trip 4.8 years. Stretching the numbers into human time makes the difference between a cache hit and a network call obvious.
How should these numbers change how I design systems?
They explain why caching, locality and avoiding network hops matter so much. Each step down the hierarchy, from cache to memory to SSD to the local network to another region, is one to three orders of magnitude slower than the last. A design that turns a memory read into a same-datacenter call makes that operation about 5,000 times slower. The numbers are the intuition behind keeping hot data close and batching or avoiding remote calls.
Are these numbers exact?
No. They are order-of-magnitude figures, and real values shift with hardware generations: modern NVMe drives, memory systems and networks can beat or miss them depending on the machine and the load. The point is the relative scale, which has stayed remarkably stable. The gaps between cache, memory, storage and network are what matter, and those ratios hold far better than any single absolute number does, so measure your own hardware when precision matters.
Why is a cross-continent round trip so slow?
Mostly physics. Light in optical fiber travels at roughly two thirds of its speed in a vacuum, about 200 kilometers per millisecond, and a California to Netherlands round trip is at least 17,500 kilometers even along the great circle, which sets a floor of almost 90 milliseconds before any routing or processing. Real paths are longer than great circles, and routers add delay, which is how the classic figure reaches 150 ms. Caching and edge servers are the only real fix.