title: Fastest way to loop through a 2d array?
body: <p>I just stumbled upon <a href="http://lbrandy.com/blog/2009/03/more-cache-craziness/" rel="nofollow noreferrer">this blog post</a> about cache algorithms.</p>
  <p>The author shows two code samples that loop through a rectangle and compute something (my guess is the computing code is just a placeholder).</p>
  <p>On one of the examples, he scans the rectangle vertically, and on the other horizontally. He then says the second is fastest, and that every programmer should know why. Now I must not be a programmer, because to me it looks exactly the same.</p>
  <p>Can anyone explain why the former is faster?</p>