AoS: Best for Single-Entity, Full-Data Access

Array of Structs (AoS) is optimal when your code frequently accesses all members of a single 'object' or entity contiguously. This pattern leverages cache lines efficiently by bringing the entire object's data into the CPU cache at once, minimizing cache misses for subsequent accesses to that same object's fields.

Sources

Open the full topic