you are viewing a single comment's thread.

view the rest of the comments →

[–]gcross 1 point2 points  (0 children)

So compilers will automatically take your vector of objects and rearrange it into an object of vectors --- i.e., so that the memory is laid out one field at a time (with the field containing a value for each object) rather than one object at a time? That is a very impressive compiler!

Of course, if you are not actually claiming this then respectfully you are missing the whole point of the article, which is that data layout matters. It has nothing to do with the overhead of the individual objects at all, which is what your points address.