Hacker News new | ask | show | jobs
by devbug 4132 days ago
Unfortunately it is not as simple when you have to account for different threads on different cores accessing the same structure, as mentioned in the article. [1] Or the performance implications of managing multiple instances of structures. [2] Or the alignment requirements for doing SIMD. [3]

Additionally, it sometimes makes sense to duplicate data to minimize cache misses. For example, translating/rotating/scaling entities in game engines. It makes sense to copy entity transforms (usually a matrix computed once) from a central manager to sub-managers for certain components. The memory overhead is traded for more efficient processing in sub-systems like rendering, animation, physics, etc.

---

[1]: http://en.wikipedia.org/wiki/False_sharing

[2]: https://software.intel.com/en-us/articles/a-case-study-compa...

[3]: https://software.intel.com/sites/products/documentation/docl...