liveBook · Manning

Array of structs

An array of structs is a collection of records in which each array element stores multiple fields belonging to one item.

How 2 Manning books explain it

High Performance Unity Game Development

An array whose elements are struct values stored together in the array's contiguous memory block.

How it is used
Uses grouped struct data when fields are always accessed together and no other logic needs them separately.
How deep it goes
Explains contiguous array storage and contrasts it with class-reference arrays, but does not provide performance measurements.
Examples
Uses coin pickup UI animations with current and target positions and velocity.
What you can do after
Evaluate whether related fields belong together in an array of structs or separate arrays.

Read how High Performance Unity Game Development explains array of structs →

Grokking GPU Programming

An array of structures stores records as an array in which each element contains multiple fields belonging to one record.

How it is used
Guides GPU data-layout choices by showing when interleaved records produce strided memory accesses.
How deep it goes
Explains record layout, thread strides, and coalescing, then compares SoA performance for selected workloads.
Examples
Uses particle position and velocity records to contrast AoS and SoA layouts and show particle updates.
What you can do after
Evaluate whether AoS or SoA better suits a kernel’s field-access pattern.

Read how Grokking GPU Programming explains array of structs →

Also covered in

What to know first

Related concepts

Questions about array of structs

What is array of structs?

An array of structs is a collection of records in which each array element stores multiple fields belonging to one item.

Which Manning books explain array of structs?

High Performance Unity Game Development and Grokking GPU Programming.

What should I know before learning array of structs?

Manning books that teach array of structs usually introduce cache line, data-oriented programming and tensor first.

What is the difference between array of structs and struct of arrays?

An array of structs is a collection of records in which each array element stores multiple fields belonging to one item. A struct of arrays is a data layout that stores each field of multiple records in a separate array, with corresponding positions belonging to the same record.

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.