Caffeinated Coder
Book an appointment
Lesson 27 · Building and performance

Writing fast C++

Fast C++ starts with an optimised build and a measurement, and very often ends with memory. Follow two loop nests that add up the same 4 × 4 grid: one walks memory in the order it is stored and pays one cache miss per line, the other jumps by a whole row on every read and misses every time. Same instructions, same answer, very different speed.

12 min9 steps5 questionsAdvanced
Fig 27 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.