Hardware Innovations: Hiding Memory Latency
Modern CPUs employ sophisticated techniques like prefetching, out-of-order execution, and branch prediction to anticipate data needs and execute instructions non-sequentially, effectively hiding some of the high main memory latency.
The top 3
- CPU Prefetching: Anticipating Data Needs: Modern CPUs employ sophisticated hardware prefetchers that monitor memory access patterns to predict future data requirements, automatically fetching data into faster caches to proactively hide memory latency before it's explicitly requested. [3, 16, 18]
- Out-of-Order Execution: Masking Memory Stalls: CPUs with out-of-order execution dynamically reorder instructions, allowing independent operations to execute while earlier instructions wait for slow memory accesses, thereby masking latency and keeping execution units fully utilized. [1, 2, 5, 10, 11]
- Cache Latency Hierarchy: Orders of Magnitude Faster: L1 cache access typically takes ~1-4 CPU cycles, L2 ~10-14 cycles, and L3 ~30-40 cycles, dramatically contrasting with main memory's ~150-300 cycles. This multi-level hierarchy significantly bridges the speed gap to hide latency. [3, 4, 6, 7, 9, 13, 15]
Sources
Open the full topic