Memory Hierarchy
Roughly how many times longer is a main-memory DRAM access than an L1 cache hit (for typical PC or server CPUs)?
- A2 to 3 times
- BTens to about a hundred times
- CMore than 100,000 times
Show answer and explanation
Answer: B. Tens to about a hundred times
An L1 hit takes a few cycles (around 1 ns), while a DRAM access takes tens to about 100 ns, a difference of tens to a hundred times. For a CPU running at several GHz that means waiting hundreds of cycles, which is why cache hierarchies and prefetching are essential to performance. If the gap were only 2 to 3 times, caches would matter far less. More than 100,000 times is closer to the gap with SSDs or hard disks, not DRAM.
- A. The gap is far larger than 2 to 3 times.
- B. Correct. Tens to a hundred times, equal to hundreds of CPU cycles.
- C. More than 100,000 times is closer to the gap with storage.