Fastest way to loop through a 2d array?

前端 未结 6 1246
余生分开走
余生分开走 2020-12-02 15:39

I just stumbled upon this blog post. The author shows two code samples that loop through a rectangle and compute something (my guess is the computing code is just a placehol

6条回答
  •  庸人自扰
    2020-12-02 16:14

    Cache is indeed the reason, but if you want to know the meat of the argument, you could take a look at the "What Every Programmer Should Know About Memory" by U. Drepper:

    http://people.redhat.com/drepper/cpumemory.pdf

提交回复
热议问题