Tools — Latency
Latency numbers in human time
Make one L1 cache hit last a second and watch the rest of the stack stretch into minutes, days and years. Bars are on a log scale.
- L1 cache reference 0.5 ns1 second
- Branch mispredict 5 ns10 seconds
- L2 cache reference 7 ns14 seconds
- Mutex lock/unlock 25 ns50 seconds
- Main memory reference 100 ns3.3 minutes
- Compress 1 KB 3 µs1.7 hours
- Send 1 KB over 1 Gbps 10 µs5.6 hours
- Read 4 KB randomly from SSD 150 µs3.5 days
- Read 1 MB sequentially from memory 250 µs5.8 days
- Round trip within same datacentre 500 µs12 days
- Read 1 MB sequentially from SSD 1 ms23 days
- Database indexed lookup (typical, varies) 2 ms46 days
- Disk (HDD) seek 10 ms231 days
- Read 1 MB sequentially from HDD 20 ms1.3 years
- Round trip California to Netherlands 150 ms9.5 years
- Cross-region API call (typical, varies) 200 ms13 years
- TLS handshake, about 2 round trips (typical, varies) 300 ms19 years
- Card authorisation, 1-3 s (typical, varies) 2 seconds127 years
Classic numbers after Jeff Dean and Peter Norvig, approximate. Rows marked "typical, varies" are extras. Bar length is log scale, so each step is roughly 10x.
Privacy
Runs in your browser. Nothing is sent anywhere or stored.
Questions
Where do these numbers come from?
They are the commonly circulated list "Latency Numbers Every Programmer Should Know", popularised by Jeff Dean and Peter Norvig. The values are order-of-magnitude approximations of older hardware, so treat them as a feel for the ratios, not a benchmark.
What does "1 s = L1" mean?
Every duration is multiplied by the same factor so that one L1 cache reference (0.5 ns) takes one second. Everything else keeps its real ratio to it, so a main memory reference becomes about 3 minutes and a round trip from California to the Netherlands about 9.5 years.
What are the rows marked typical?
Extras that are not in the classic list, such as a TLS handshake, a database lookup, a cross-region API call and a card authorisation. They are rough typical values and vary widely between systems.
Does this store anything?
No. It runs in your browser, makes no network requests and stores nothing.