Memory is organized in a hierarchy ( todo ) of registers, buffers and caches and main memory with increasing latency at each level. CPUs exploit three locality rules to prefetch data efficiently:

  • temporal locality: recently accessed memory will probably be accessed again soon
  • spatial locality: memory near recently accessed memory will probably be accessed soon
  • memory access will probably follow the same pattern

TAKEAWAY: prefer algorithms and data structures that enable predictable, sequential access to data

See also

References