Memory latency numbers every programmer should know: L1 to HDD in nanoseconds
Computer memory spans 7 orders of magnitude in latency: from L1 cache at roughly 1 nanosecond to spinning HDD at roughly 10 milliseconds. Each step up the hierarchy is roughly 10-100x slower than the step below it. These numbers aren't academic. They explain why your program is slow and what to do about it.
How this is calculated
The rough latency numbers for a modern desktop CPU (2026): L1 cache ~1 ns (3-5 cycles at 4 GHz). L2 cache ~3-4 ns (12-16 cycles). L3 cache ~10-15 ns (40-60 cycles). DDR5 RAM ~50-80 ns (200-320 cycles). NVMe SSD ~50-100 µs (50,000-100,000 ns). SATA SSD ~100-200 µs. HDD ~5-15 ms (5,000,000-15,000,000 ns). To put this in human terms: if L1 cache access were 1 second, RAM access would be almost 1.5 minutes. An HDD access would be over 4 months. This is why caching works, why SSDs transformed computing, and why in-memory databases are fast.
Verdict
Every programmer should know these numbers. They're the difference between code that works and code that's fast. Keep your data as close to the CPU as possible, avoid random memory access on large datasets, and never read from disk in a hot path.
More Latency scenarios
Frequently asked questions
How much faster is L1 cache than RAM?
Is NVMe SSD faster than RAM?
Why is HDD so much slower than SSD?
What's the point of L3 cache?
How many nanoseconds is one CPU cycle?
Does DDR5 have lower latency than DDR4?
Related tools
RAM Latency Calculator
Convert DDR3/DDR4/DDR5 timings (CL, tRCD, tRP, tRAS) into true latency in nanoseconds.
Use tool ➜RAID Calculator
Calculate usable capacity and fault tolerance for RAID 0, 1, 5, 6, and 10.
Use tool ➜Display Bandwidth Calculator
Check if your HDMI/DP cable supports your resolution and refresh rate.
Use tool ➜