Hacker News new | ask | show | jobs
by vernie 3132 days ago
Yes, organizing your data in an array of structures is also bad for performance.
1 comments

Doesn’t this entirely depend on access patterns?

If you read one field of all elements all at once, sure, a structure of arrays is probably right. But what if you instead read all fields of one element at once? Isn’t it advantageous to have those fields adjacent in memory with an array of structures?