An L1 cache reference costs about ns and a main-memory reference about ns. By what factor does a cache miss slow that access?
Answer with a number. Fractions, powers and expressions like 23/6 or C(52,5) are read correctly in practice.
Show the answer and worked solution
Answer
The ratio is simply . It is worth carrying alongside the rest of the ladder: L1 about a nanosecond, L2 a few, L3 around ten, main memory a hundred, an SSD read tens of microseconds, a network round trip within a datacentre tens of microseconds. That hundredfold step is why hot-path work is counted in cache misses rather than in operations, and why a data structure that touches memory contiguously beats one with better asymptotics but a pointer chase per element.
Worked solution
- Formula
- Substitute
- Solve
- Answer
Takeaway: Main memory is about a hundred times slower than L1.
Answer it in practice – your answer is marked and recorded.
Learn the method
Latency, the memory hierarchy and why the tail is the number
Reported in interviews at
More systems and low latency questions
- You sort 1,000 latency samples in ascending order.Foundation
- A timestamp counter ticks at 3 GHz. How many ticks elapse in one microsecond?Foundation
- A burst on the feed, part 1 of 4Foundation
- Two systems: one has a mean of 2 μs and a p99.9 of 2 ms, the other a mean of 5…Applied
- You collect one million latency samples.Applied
- Two threads each increment their own atomic counter, and throughput is far…Advanced