Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Access patterns matter, but just as important is to have less stuff to access. That's why arrays-of-structs are considered cache friendly - columnar data layouts open the door to optimizations that significantly reduce memory footprint. You no longer waste memory with struct padding. Boolean fields can become bitsets. Enums can be bit-packed. Often-null optional fields can become sparse maps. 8-byte pointers can become narrower-sized indices into object pools.


> “That's why arrays-of-structs are considered cache friendly”

Sounds like you mean structs-of-arrays?


Oops, brainfart on my part. Unfortunately, the edit window has passed.




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

Search: