News for hackers. Stuff that matters.
Re:Writing memory efficient C structs by munksbeer on Friday August 01, 2025 @03:49PM (#44761567)
So, in option two, you'd be using SoA with a

  double health[];
which is the value that would be updated by healthEntity.updateHealth() ? So because you're sequentially updating only that attribute it should lend itself to being cache friendly and potentially prefetch prediction? (can't remember the term)
Re:Writing memory efficient C structs by Rayhem on Friday August 01, 2025 @05:33PM (#44762743)
Yes, exactly. If you have to update everyone's health (you do) and the updates are pretty much the same (they are), then things don't get any more cache friendly than this.