Worst Performance Traps: Mismatched Layout Access

Accessing data with a stride that doesn't match its memory layout, such as iterating columns first on row-major arrays, causes frequent cache misses (thrashing) and can slow operations by orders of magnitude compared to optimal contiguous access.

Sources

Open the full topic