logoalt Hacker News

moringtoday at 1:52 PM2 repliesview on HN

The article shows nicely how "every byte matters" is false. First, it starts off by talking about the cost of a new field, when the actual topic is array-of-structs vs. struct-of-arrays. Then, this:

> How much of an impact can this have? > Reading is:alive (1 byte) Across 1M Monsters

You aren't reading one byte here, you are reading 1M bytes! Of course, optimizing the access to 1M bytes is something to consider. Optimizing the access to one byte isn't.

The article is definitely worth reading IMHO, but it really needs a better headline!


Replies

jayd16today at 1:56 PM

Even more so, it shows that SoA data structure means you can add fields to your 1M monsters with little impact.

show 3 replies
bronlundtoday at 2:59 PM

Every Struct Matters