Understanding Spacial Locality of Reference - Articles - TopHat Stuff: "The sequence in which you access data can have major performance implications. For example, when iterating over a two dimensional array stored in row-major order, looping by x first and then by y can be up to 6.5 times slower than looping by y first and then by x.
"