L1, L2, L3: Which Cache Levels Gain Most from Spatial Locality?

L1 cache, being the smallest and fastest, benefits most significantly from high spatial locality due to its close proximity to the CPU core and single-cycle access times, followed by L2 and L3 as cache misses propagate down the hierarchy.

The top 3

  1. L1 Cache: Spatial Locality's Top Performance Driver: The L1 cache yields the most significant overall system performance boost from spatial locality, as its rapid hits (1-3 CPU cycles) drastically reduce CPU stalls compared to accessing slower L2, L3, or main memory.
  2. L1's Dominant Spatial Locality Hit Rate: The L1 cache achieves the highest hit rate increase directly from spatial locality, efficiently serving the CPU's most immediate data requirements by fetching entire cache lines (typically 64 bytes) that contain the requested data and nearby memory locations.
  3. L1's Max Latency Reduction from Spatial Locality: Exploiting spatial locality in L1 cache yields the greatest reduction in memory access latency, as an L1 hit avoids significantly slower fetches from L2 (10-20 cycles), L3 (30-70 cycles), or main memory (hundreds of cycles).

Sources

Open the full topic