Hacker News new | past | comments | ask | show | jobs | submit login

> SOA: [xxxx][yyyy][zzzz][wwww]

That difference only occurs if, for some random reason, you came about what's the address of element zero of that array, or if for any even rarer reason you have a hard requirement of when you cease to process x and start to process y, and you find a single memory jump prohibitively expensive.

Meanwhile, AOS is already by definition [xxxx] and [yyyy] and [zzzz] and [wwww], given the remaining members of the struct are treated as padding.




> Meanwhile, AOS is already by definition [xxxx] and [yyyy] and [zzzz] and [wwww]

There must be a misunderstanding here. AOS is by definition [xyzw][xyzw](...), the (C/C++) compiler has no leeway in rearranging this. I'm also assuming that there's no padding necessary, in either case.

Perhaps my way of notation is confusing, in that case I'm going to refer you to this page, which has code examples:

https://software.intel.com/content/www/us/en/develop/article...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: