liveBook · Manning

Contiguous memory layout

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

How 2 Manning books explain it

Fast Python: High performance techniques for large datasets

How it is used
Uses memory layout to explain performance differences between matrix access patterns and motivate cache-aware NumPy processing.
How deep it goes
Explains cache reuse through matrix traversal and relates array views to strides, but leaves allocation details for later.
Examples
Compares doubling adjacent matrix elements with doubling elements separated across rows, and demonstrates reshaped and transposed NumPy views.
What you can do after
Understand how data layout and traversal order affect cache reuse when accessing matrices and NumPy arrays.

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 →

Related concepts

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.