Cache-Aware Layout Lab
CP25C01 · Advanced Data Structures · Ex. 2

Cache-aware data structures and memory use

Four experiments on the memory hierarchy: row vs column traversal, naive vs tiled transpose, array-of-structures vs structure-of-arrays, and a pointer-chasing list vs a contiguous array. Set the sizes, run, and compare the results with the ideal-cache model.

Inputs

4096 needs about 300 MB of free memory and can fail on phones.

Up to 5 values, each from 2 to n.

Use your L1 data cache (32 or 48 KB) or L2. The model needs 2·b²·8 bytes ≤ cache.

Each test is repeated r times and the minimum time is reported.

Ready.
Running the first experiment…