1 2 3 4 5 | struct pointlist3D { float x[N]; float y[N]; float z[N]; }; |
This is how I think the data is laid out based on the above struct.
xxxxyyyyzzzz
If I understand it correctly, if you have a function that needs to add x[i],y[i],z[i] together, they all have to be inside the fast cache for the operation to be fast. But if N is large, the first x will be far away from the first y and z, thus they can't all be in the same cache at the same time. Or does the CPU have more than one super fast cache, and it puts the xs, ys, and zs in them, so they can be accessed fast.
This isn't a question about data oriented design, its about the cache. Is there more than one fast cache, or is there just one, and they are doing something I am not seeing.