3 ms·
Not really. There's no silver bullet when it comes to AoS or SoA. If you have a pair of integers, A and B, that are supposed to be always read/write together, t
by ratww 5y ago
Not really. There's no silver bullet when it comes to AoS or SoA. If you have a pair of integers, A and B, that are supposed to be always read/write together, the ABABAB of ECS beats AAA...BBB in terms of cache locality, hands down.
The advantage of ECS in this case is that it enforces data organisation to be coherent to the way data is used.
All this is mentioned on the seminal articles about Data-oriented Design, including the ones that popularised the terms AoS and SoA, and in lots of literature about modern ECS.
I suggest looking up what Entities and Components mean in ECS. It is doing all those things you're thinking of, but in a more optimal way.