Lab · c06.s04.L1

Memory-hierarchy ladder

The wait for a load is set by where its bytes live, so the same loop climbs a four-step staircase as the table grows.

Question: Why does the same arithmetic run at so many speeds?

Memory-hierarchy ladderA ladder of eight rungs, 4 KiB to 256 MiB, on a log scale of wait per load. Each rung is a band spanning two runs, so it is a range, not a digit. The wait is flat through 512 KiB, then jumps at 2 MiB and at 8 MiB; the top rung reaches 254 nanoseconds per load, 157 and 139 times the 512 KiB rung. A gold column climbs the rungs as the readout names size and wait.Memory-hierarchy ladderOne loop of dependent loads; each wait is measured above that run's 4 KiB chase8 rungs · 4 levels · wait per load 0.00835–254 ns · the top rung is 157× and 139× the 512 KiB rungrun Arun B0.010.1110100wait per load, ns (log scale)4 KiB0.00835–0.0375 ns32 KiB0.35–0.858 ns128 KiB1.13–1.54 ns512 KiB1.62–1.69 ns2 MiB20–22.6 ns8 MiB98.2–168 ns32 MiB188–224 ns256 MiB234–254 nsfirst level · 0.00835–1.69 nssecond level · 20–22.6 nsthird level · 98.2–224 nsfourth level · 234–254 ns2 MiB: wait per load 20–22.6 ns · whole walk 20–22.6 µssecond level · level band 20–22.6 nsStep since 512 KiB: 14× and 11.8×.
Published Published: the measured pointer-chase ladder of seed v1c10 (NUMBERS.md section B), on an Apple M1 Pro, two runs of the same protocol. Each rung is the wait per dependent load above that run's 4 KiB chase, so the loop's own cost of 15.2–16.2 ns per load is already removed. The bar spans the two runs; a rung is a range, not a digit. The frames move the gold highlight up the ladder from the chosen size; each frame names the rung, its band, the whole-walk total and the level it belongs to.
Lab controls
2 MiB

Arrow keys move one rung, Home goes to 4 KiB, End goes to 256 MiB

700 ms per rung

Arrow keys move 100 ms, Page Up/Down move 200 ms, Home goes to 400, End goes to 1600

Frame 1 of 4: 2 MiB rung2 MiB: 20–22.6 ns per load, 20–22.6 µs per walk. The step from 512 KiB is 14× and 11.8×, and this rung opens the second level.

2 MiB rung. 2 MiB: 20–22.6 ns per load, 20–22.6 µs per walk. The step from 512 KiB is 14× and 11.8×, and this rung opens the second level.

Keyboard: Space plays or pauses, Left and Right step, Home goes to the first frame, End goes to the last frame.

Text description of this lab

A ladder of eight rungs, 4 KiB to 256 MiB, on a log scale of wait per load. Each rung is a band spanning two runs, so it is a range, not a digit. The wait is flat through 512 KiB, then jumps at 2 MiB and at 8 MiB; the top rung reaches 254 nanoseconds per load, 157 and 139 times the 512 KiB rung. A gold column climbs the rungs as the readout names size and wait.

Return to the section that hosts this lab

Caption status: published. Every lab declares one of published, re-simulated, schematic, synthetic or interpolated.