liveBook · Manning

Data locality

Data locality is the relationship or constraint between where data is stored and where it is accessed or processed, including spatial proximity and geographic or organizational boundaries.

How 5 Manning books explain it

High Performance Unity Game Development

The degree to which related data is stored or accessed close together in the memory hierarchy.

How it is used
Organizes frequently processed gameplay data so sequential updates make better use of CPU cache lines.
How deep it goes
Works through aligned cache lines, movement inputs, and array iteration, while noting that nearby fields can still span lines.
Examples
Uses enemy movement and player tracking, parallel C# arrays, and a C# List versus linked-list comparison.
What you can do after
Build it from scratch with arrays organized around update inputs, then evaluate further optimization by profiling target hardware.

Read how High Performance Unity Game Development explains data locality →

Fast Python: High performance techniques for large datasets

How it is used
Guides data-processing choices by relating data placement and representation to access costs and CPU efficiency.
How deep it goes
Explains memory-tier costs, cache effects, compression trade-offs, and uncertainty in virtualized environments.
Examples
Uses compressed versus raw data, NumPy array representation, and local-disk versus remote-server access as examples.
What you can do after
Evaluate data-placement and representation trade-offs with attention to cache, storage, and network costs.

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.

Read how Idiomatic Rust explains data locality →

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 →

Also covered in

What to know first

Related concepts

Questions about data locality

What is data locality?

Data locality is the relationship or constraint between where data is stored and where it is accessed or processed, including spatial proximity and geographic or organizational boundaries.

Which Manning books explain data locality?

High Performance Unity Game Development, Fast Python: High performance techniques for large datasets, Deep Learning with PyTorch, Second Edition, Idiomatic Rust and 100 Go Mistakes and How to Avoid Them.

What should I know before learning data locality?

Manning books that teach data locality usually introduce mean, memory, array and parallelism first.

What is the difference between data locality and linked list?

Data locality is the relationship or constraint between where data is stored and where it is accessed or processed, including spatial proximity and geographic or organizational boundaries. An ordered sequence of elements stored in separate nodes connected by links or references rather than in one contiguous storage region.

What kinds of data locality are there?

Kinds of data locality include spatial locality and temporal locality.

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.