Hacker News new | ask | show | jobs
by Rendello 9 days ago
> SoA is not universally better.

This is an important part of Data-oriented Design: the representation of the data should be pragmatically tied to its access patterns, not dogma.

Richard Fabian's DoD book gives the example that (x,y,z) is almost always better as a classic array-of-structs rather than a struct-of-arrays, because if you're accessing one dimension, you probably are want to process the other two dimensions at the same time:

https://www.dataorienteddesign.com/dodbook/node9.html#SECTIO...