Systems and low latency
An L1 cache reference costs about 1 ns and a main-memory reference about 100 ns.
An L1 cache reference costs about 1 ns and a main-memory reference about 100 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.
Try it
Next free question: What does the recurrence T(n) = 2T(n/2)+O(n) solve to?
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.
Report an issue with this question
Learn the method
Latency, the memory hierarchy and why the tail is the number
Of the kind reported at
More systems and low latency questions
- Two systems: one has a mean of 2 μs and a p99.9 of 2 ms, the other a mean of 5…Applied · Free solution
- Two threads each increment their own atomic counter, and throughput is far…Advanced · Premium
- A burst on the feed, part 3 of 4Advanced · Premium
- Your load generator sends the next request only after the previous response arrives.Expert · Premium
- You sort 1,000 latency samples in ascending order.Foundation · Premium
- A timestamp counter ticks at 3 GHz. How many ticks elapse in one microsecond?Foundation · Premium