liveBook · Manning

Contiguous memory layout

A contiguous memory layout stores adjacent data elements at adjacent memory addresses without gaps between them.

How 3 Manning books explain it

Fast Python: High performance techniques for large datasets

How it is used
Explains how memory layout affects the cost of data-processing operations.
How deep it goes
Explains cache-related traversal costs and array strides, while deferring fuller allocation details.
Examples
Compares doubling matrix rows and columns and demonstrates NumPy arrays reshaped and transposed as shared-memory views.
What you can do after
Understand why access order and array strides can change processing costs.

Read how Fast Python: High performance techniques for large datasets explains contiguous memory layout →

Idiomatic Rust

Contiguous memory is a region whose elements occupy adjacent memory addresses.

How it is used
Motivates Vec as a common choice by linking contiguous storage to performance and straightforward element movement.
How deep it goes
Explains cache locality, compiler optimization opportunities, and element shifting, while noting that alternatives can win some workloads.
Examples
Compares Vec, HashSet, and LinkedList benchmarks for appending, searching, and removing elements.
What you can do after
Evaluate Vec against other structures and benchmark before adopting a more complex data structure.

Read how Idiomatic Rust explains contiguous memory layout →

High Performance Unity Game Development

A region of memory in which elements occupy adjacent addresses without gaps between them.

How it is used
Improves data locality by keeping values together for efficient access during game-data traversal.
How deep it goes
Explains array layouts, cache effects, and heap fragmentation with a worked allocation example.
Examples
Uses arrays of different sizes to demonstrate fragmentation and contrasts List storage with linked-list nodes.
What you can do after
Apply it by choosing contiguous arrays for frequently traversed values and grouping related heap allocations by lifetime.

Read how High Performance Unity Game Development explains contiguous memory layout →

Also covered in

What to know first

Related concepts

Questions about contiguous memory layout

What is contiguous memory layout?

A contiguous memory layout stores adjacent data elements at adjacent memory addresses without gaps between them.

Which Manning books explain contiguous memory layout?

Fast Python: High performance techniques for large datasets, Idiomatic Rust and High Performance Unity Game Development.

What should I know before learning contiguous memory layout?

Manning books that teach contiguous memory layout usually introduce array, heap, integer and NumPy array first.

What is contiguous memory layout a kind of?

Contiguous memory layout is a kind of memory layout. Memory layout is the arrangement and mapping of data elements or regions to locations in memory.

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.