Data locality
Data locality describes the relationship between where data is located and where or how it is accessed or processed, including proximity, reuse, and location constraints.
Fast Python: High performance techniques for large datasets
- How it is used
- Guides performance decisions by relating data placement to processing costs across memory, storage, and cloud environments.
- How deep it goes
- Explains memory-hierarchy costs, cache proximity, and virtualization caveats, but gives no optimization procedure.
- Examples
- Uses NumPy array representation, on-the-fly decompression, and access-time comparisons across memory and storage tiers.
- What you can do after
- Evaluate placement trade-offs by comparing access costs and keeping needed information close to the CPU, ideally in L1 cache.
Read how Fast Python: High performance techniques for large datasets explains data locality →
Deep Learning with PyTorch, Second Edition
The tendency for nearby memory accesses to hit nearby stored data, which improves performance.
- How it is used
- Uses locality to motivate convolutions for image-recognition networks.
- How deep it goes
- Explains neighborhood-limited weighted sums, then extends locality through stacked convolutions and pooling.
- Examples
- Uses birds-versus-airplanes images, small kernels, max pooling, and a large-cross visualization.
- What you can do after
- Understand why convolutional networks use small kernels and pooling to recognize image structures across larger spatial regions.
Read how Deep Learning with PyTorch, Second Edition explains data locality →
Idiomatic Rust
Data locality is the tendency for a program to access data near recently accessed or related data in memory.
- How it is used
- Use data locality to explain why contiguous Vec storage can improve performance and why alternatives merit benchmarking.
- How deep it goes
- Defines locality through nearby memory access and links contiguous storage to cache behavior, without detailing hardware internals.
- Examples
- Compares append, search, and removal timings for Vec, HashSet, and LinkedList.
- What you can do after
- Evaluate collection choices by benchmarking workloads, and favor Vec when unsure.
100 Go Mistakes and How to Avoid Them
Data locality is the tendency for related or recently accessed data to reside near one another in memory or storage.
- How it is used
- Diagnoses how memory-access patterns influence CPU-cache effectiveness during optimization.
- How deep it goes
- Explains temporal and spatial locality, cache-line transfers, cache levels, and compulsory misses without detailing cache-replacement decisions.
- Examples
- Uses Go slice-summing functions, sequential access, and stride-two or stride-eight traversal.
- What you can do after
- Evaluate how sequential and strided slice access interacts with cache lines.
Read how 100 Go Mistakes and How to Avoid Them explains data locality →
Related concepts
- linked listcontrasts with · An ordered sequence of elements stored in separate nodes connected by links or references rather than in one contiguous storage region.
- spatial localityincludes · Spatial locality is the tendency for memory locations near a recently accessed location to be accessed soon afterward.
- data-oriented programmingproduced by · Data-oriented programming is an approach to structuring software around data representations, access patterns, and operations suited to the data's characteristics and intended use.
- temporal localityincludes · Temporal locality is the tendency for recently accessed data or memory locations to be accessed again soon.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



