Hacker News new | ask | show | jobs
by speedplane 1876 days ago
> Instead, we should be using game-style "data oriented programming" a.k.a. "column databases" for a much higher performance.

This makes logical sense, but I don’t buy it in practice. Most of the heavy data reads are handled by databases, which do optimize for this stuff. I just doubt that, in most software, a significant amount of software performance issues are a result of poor memory alignment of data structures.

2 comments

Cache misses can lead to major slowdowns.

Everything depends on the access patterns in critical loops. If you need most of the fields of a struct in each iteration, the classic way is beneficial. If you need a narrow subset (a "column") of fields in a large collection of objects, splitting objects into these columns speeds things up.

The most upvoted stackoverflow question is about branch prediction (which is caching in a way):

https://stackoverflow.com/questions/11227809/why-is-processi...

When your datasets are quite large a sql database becomes an absurd bottleneck. Think of weather or aerodynamics simulations.