PDF Presentation - Uplinq
PDF Presentation - Uplinq
PDF Presentation - Uplinq
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Data Cache Performance Implications<br />
• Write cache-friendly code by using temporal and spatial<br />
locality; keep as much data in your caches as possible<br />
• Improves execution time and saves power!<br />
• Example: Process a two-dimensional array<br />
row-by-row (good spatial locality)<br />
for (i = 0; i < numRows; i++)<br />
column-by-column (bad spatial locality)<br />
for (j = 0; j < numColumns; j++)<br />
for (j = 0; j < numColumns; j++)<br />
for (i = 0; i < numRows; i++)<br />
process(array[i][j]);<br />
process(array[i][j]);<br />
10