This type of implementation, while simple, can exhibit poor performance due to poor cache-line utilization, especially when "N" is a power of two (due to cache-line conflicts in a CPU cache with limited associativity). The reason for this is that, as "m" is incremented in the inner loop, the memory address corresponding to "A"("n","m") or "A"("m","n") jumps discontiguously by "N" in memory (depending on whether the array is in column-major or row-major format, respectively). That is, the algorithm does not exploit locality of reference.