What is a “cache-friendly” code?

前端 未结 9 2323
误落风尘
误落风尘 2020-11-22 02:16

What is the difference between \"cache unfriendly code\" and the \"cache friendly\" code?

How can I make sure I write cache-efficie

9条回答
  •  感动是毒
    2020-11-22 03:06

    Welcome to the world of Data Oriented Design. The basic mantra is to Sort, Eliminate Branches, Batch, Eliminate virtual calls - all steps towards better locality.

    Since you tagged the question with C++, here's the obligatory typical C++ Bullshit. Tony Albrecht's Pitfalls of Object Oriented Programming is also a great introduction into the subject.

提交回复
热议问题