AoS vs. SoA: Array of Structures versus Structure of Arrays @WhatsACreel
AoS vs. SoA: Array of Structures versus Structure of Arrays  @WhatsACreel
Uploaded June 2014 | Updated November 2026, 2 days ago
Today we'll look at a very interesting performance programming technique. It is used when programming SIMD, and stream processing hardware, like an SSE capable CPU or the GPU. It involves a perpendicular rotation of data in RAM. It is known as AoS vs. SoA (or SoA vs AoS). It stands for Array of Structures versus Structure of Arrays.

Most of the time we organize our data into structures, then we create arrays of these structures and work on the elements of the array with a loop. We can, however, organize our data into a single structure, which contains a arrays for each element of the previous structure. We are storing exactly the same data, it's just rotated.

The question this tutorial examines is, does rotating our data 90 degrees help performance? Are we able to better utilize the hardware's capabilities if we set out our data a little differently?

The choice of AoS or SoA is one that is easiest made at the start of a project. It is not often convenient to change an existing project from AoS to SoA.
AoS vs. SoA: Array of Structures versus Structure of ArraysDirect3D 11 1: Introduction and WindowIntro to Rust Programming Language (Installing guide, cargo and simple examples, vs C++)Modern x64 Assembly 14: Structures in ASM and C++The Sorting Algorithm Olympics - Who is the Fastest of them AllC++ Tutorial 3: If Statements and ConditionsPerformance x64: Cache Blocking (Matrix Blocking)C++ Bit FieldsModern x64 Assembly 13: Control Structures (If statements, do while, while and for loops)IEEE 754: 32 Bit Single Precision FloatsObject Oriented Programming is a Dirty Rotten Low Down Trick: A Look at How C++ WorksLearn Python Programming 2: Arithmetic Operators
Creel |

AoS vs. SoA: Array of Structures versus Structure of Arrays

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER