4 ms·
Cache locality is kind of the whole point of it. Some algorithms benefit hugely if you choose a specific layout. Other algorithms do some kind of random access
by std_throwaway 7y ago
Cache locality is kind of the whole point of it. Some algorithms benefit hugely if you choose a specific layout.
Other algorithms do some kind of random access to a few fields only and they don't benefit at all. Those algorithms can make up 90% of your code but only account for 10% of the computation. Therefore it would be easier to have your data look like a AoS in 90% of your code but actually be stored as a SoA to gain the speed in 90% of the computation.