OOP’s impact on data arrangement was a 35 year mistake
Casey Muratori at the Better Software Conference walks us through how data in game development (and other systems) started with simple coherent structures that were best for cpu and cache coherency layout and then morphed into hierarchies of objects that following the in-vogue trend of late 90’s programming.
This lead to changing the compile-time data arrangement from what’s best for the computer to compiling data into arbitrarily arranged memory locations that matched the real-world things you’re trying to model.
He does a great job of breaking down the history and effects of what has happened in the 20 years since. I remember going to a GDC talk in which a game developer building a racing game struggled and struggled to get performance from his OOP arranged data. In the end, he realized that he should simply lay out the data in memory linearly and got multiple times more speed.
Today, developers from racing games to AI are re-discovering that laying things out linearly and adhering to cache consistent access (ex: GPUs) is where the highest end performance is unleashed.