Cache Locality
overview
Summary
cache_locality is about using data the CPU will see again soon or nearby in memory. temporal_locality means reusing the same items shortly. spatial_locality means touching neighbors in an address range. Data moves in fixed-size cache_lines. A cache_hit is fast; a cache_miss is slow. Keep the working_set small relative to the memory_hierarchy levels like L1, L2, and L3. Favor sequential_access and contiguous layouts to help prefetch and improve hit rates.