Performance Considerations and Modern Systems 195
its four neighbors (up, down, left, right), where the boundaries wrap
around (e.g., the upper neighbor of array elements on the top row are
the elements in the same column on the bottom row).
Measure the amount of time required to execute a number of iterations
of the doubly nested loop. Now, switch the indices that each loop corre-
sponds to and measure how the timing of the loop changes. Discuss what
you see in relation to row-versus-column major ordering and caches.
3. Using the example of cooking a meal in the introduction, identify the
parts of the process of preparing the meal that are inherently sequential
and those that can be parallelized. How does Amdahl’s law impact show
up in real-world