Optimizing member variable order in C++

前端 未结 10 688
长发绾君心
长发绾君心 2020-12-04 07:18

I was reading a blog post by a game coder for Introversion and he is busily trying to squeeze every CPU tick he can out of the code. One trick he mentions off-hand is to

10条回答
  •  既然无缘
    2020-12-04 07:55

    In theory, it could reduce cache misses if you have big objects. But it's usually better to group members of the same size together so you have tighter memory packing.

提交回复
热议问题