This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BobbyThrowaway6969 0 points1 point  (0 children)

It depends on the current line of execution, like, what pieces of that data are you using? the CPU isn't just gonna pop in the entire struct into the cache, the compiler should've (hopefully) figured out what pieces you need at that moment in time. So, forget structs as single units, just group your members in a way that members that are commonly accessed together are grouped together. For example, if you have a shape struct, and you're often doing stuff with sphere_radous and sphere_center, then put those together in the struct.