Content deleted Content added
Mesospheric (talk | contribs) |
→Cache behavior: Add illustration |
||
Line 28:
===Cache behavior===
[[File:Row_and_column_major_order.svg|thumb|upright|Illustration of row- and column-major order]]
The three loops in iterative matrix multiplication can be arbitrarily swapped with each other without an effect on correctness or asymptotic running time. However, the order can have a considerable impact on practical performance due to the [[locality of reference|memory access patterns]] and [[CPU cache|cache]] use of the algorithm;<ref name="skiena">{{cite book |first=Steven |last=Skiena |authorlink=Steven Skiena |title=The Algorithm Design Manual |publisher=Springer |year=2008 |pages=45–46, 401–403 |doi=10.1007/978-1-84800-070-4_4}}</ref>
which order is best also depends on whether the matrices are stored in [[row-major order]], column-major order, or a mix of both.
|