Skip to main content
← Lab

prefetch

confirmedshipC · Apple M4Systems & data structuresJuly 17, 2026

the question

How far does the Apple M4 data prefetcher reach, and does a stride beyond one cache line expose full memory latency?

what came out

Out of cache, only next-line (64B) access runs at prefetch speed: 0.70ns at 512MB, versus 2.47ns at a 128B stride, 3.5x slower, and near 3ns for larger strides. The 4MB in-cache control is flat across strides, ruling out TLB.

method & receipts

  • Result: confirmed
  • Pre-registered the prediction was written down and committed before the run.
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/prefetch