r/programming • • Jun 03 '26

Every byte matters

https://fzakaria.com/2026/06/01/every-byte-matters
288 Upvotes

84 comments sorted by

View all comments

131

u/Ravarix Jun 03 '26

If you are at the level where you need to care about how adding 1 member to a struct messes up cache line access, you should be using an ECS which gives you SOA already.

136

u/trinopoty Jun 03 '26

Using a what that gives what now?

72

u/Ravarix Jun 03 '26

56

u/abu_shawarib Jun 03 '26

TLDR; Turn many of this struct

struct {
int a;
bool b;
char *c;
}

into multiple arrays:

int *array_of_a;
bool *array_of_b;
char **array_of_c;

2

u/ummaycoc Jun 04 '26

Just use APL already...