Morton layout is a compromise storage layout between the programming language mandated layouts row-major and column-major, providing substantial locality of reference when traversed in either direction. This paper explores the performance of Morton, row-major and column-major layouts in detail on some representative architectures. Using a small suite of dense kernels working on two-dimensional arrays, we have carried out an extensive study of the impact of poor array layout and of whether Morton layout can offer an attractive compromise. Whether Morton layout is better than traversing a column-major array in row-major order (or vice versa) depends on problem size and architecture. Morton layout generally leads to much more consistent performance and only a small improvement in its performance could make it an attractive alternative.
pubs.doc.ic.ac.uk: built & maintained by Ashok Argent-Katwala.