TechCompare LogoTechCompare

Memory latency numbers every programmer should know: L1 to HDD in nanoseconds

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.

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.

By TechCompare · Updated

Hardware tier
Fundamentals
Memory hierarchy fundamentals
Topic focus
Memory latency numbers
latency-numbers

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

The ladder spans seven orders of magnitude and that scale is the whole lesson. L1 at roughly 1 ns climbs through L2 (3-4 ns), L3 (10-15 ns), DDR5 (50-80 ns), NVMe (50-100 microseconds), SATA SSD (100-200 microseconds), to HDD (5-15 ms). Compressed to human time, if L1 were one second, RAM would be one and a half minutes and an HDD read would take four months. That ratio is why caching works and why in-memory databases feel instant.

More Latency scenarios

L1 vs L2 cache
L1 cache is the fastest memory in a computer, typically 1 ns latency (3-5 CPU cycles) and 32-64 KB per core.
View details ➜
L3 cache vs RAM
L3 cache (also called Last Level Cache or LLC) is shared across all cores in a CPU chiplet, typically 16-96 MB, with latency of 10-15 ns.
View details ➜
DDR4 vs DDR5 latency
DDR5 roughly doubles the peak bandwidth of DDR4 (from ~50 GB/s to ~100 GB/s per module), but true latency measured in nanoseconds is nearly unchanged.
View details ➜

Frequently asked questions

What are the memory latency numbers every programmer should know?
Roughly: L1 cache 1 ns, L2 3-4 ns, L3 10-15 ns, DDR5 RAM 50-80 ns, NVMe SSD 50-100 microseconds, SATA SSD 100-200 microseconds, HDD 5-15 milliseconds. Every tier is about 10-100x slower than the one above it. Knowing the ladder tells you where a slow program is actually waiting.
What does the 'if L1 cache were 1 second' analogy look like?
At that scale, an L2 access is a 3-4 second pause, L3 is 10-15 seconds, RAM is about 1.5 minutes, an NVMe SSD read is a day and change, and a spinning HDD read is over four months. The analogy isn't decorative - it's why reading from disk in a hot code path is a catastrophe even when the profiler says I/O is a small slice.
Why are in-memory databases so much faster?
They skip the 50-100 microsecond NVMe trip and keep the working set in RAM at 50-80 nanoseconds, roughly a thousand times faster per random access. A disk-backed database with a good cache layer narrows the gap for hot data, but the first uncached read still pays the disk latency. That three-order gap is the entire value proposition.