4 ms·
Structure of arrays vs. array of structures. I.e. Having one struct that contains several arrays as its members, vs. having one array that contains several stru
by Kronopath 10y ago
Structure of arrays vs. array of structures. I.e. Having one struct that contains several arrays as its members, vs. having one array that contains several structs as its elements. The former keeps like data together, so when you need to, for example, iterate over the position vectors of a bunch of objects in a 3D graphics program, all the position vectors for all the objects are tightly packed in the same array, increasing cache efficiency.
- userbinator 10y agoI've always called those "parallel arrays" --- and they were around long before Service Oriented Architectures: https://en.wikipedia.org/wiki/Parallel_array https://en.wikipedia.org/wiki/Parallel_array