The Runtime Theory
mediumCS:APP Cache Lab#controlled-experiment#cache-misses

Measure a Cache-Locality Change

Use a repeatable matrix workload to compare loop order, profile cache behavior, and report what the measurement can support.

The Runtime Theory Team1 min read
Solve it

Solving happens on the judge — come back and mark it done

Sample cases

inMeasure row-major and column-major sums over the same matrix

outReport repeated timings, environment, and a plausible locality explanation

inChange matrix size beyond a cache level

outCheck whether the relative behavior changes and avoid inferring a universal ratio

Create a benchmark that sums the same matrix with two loop orders. Keep the compiler flags, data, output, warm-up, and environment consistent. Repeat enough times to see run-to-run variation and report the median plus spread rather than one best result.

Use a profiler or hardware counters when available to test whether cache misses changed. If they did not, revise the explanation. Then try tiling and compare the added code complexity with the measured improvement.

Your report should state CPU model, compiler, optimization level, dimensions, measurement method, and limitations. The linked CS:APP Cache Lab offers a deeper simulator-based exercise.

One dispatch a week

The trace behind each problem, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save