Semicolony ELI5 · comic

CPU cache.

Keeping the tools you reach for most in your apron pocket, not on the far shelf.

  1. pocket near shelf far shelf storeroom fastest slowest
    1

    Speed tiers, by distance: pocket, near shelf, far shelf, the back storeroom.

  2. Got it.
    HIT
    2

    A tool already in the apron pocket is right there — that’s a cache hit.

  3. Hang on…
    far shelf MISS
    3

    Not in the pocket? Stop and walk to the far shelf — a miss, and a long wait.

  4. wanted neighbours, grabbed too
    4

    So when it fetches one thing, it grabs the neighbours too, betting you’ll want them.

  5. hit · hit · hit · hit
    5

    Work along a row in order and almost everything is already in reach — hit after hit.

  6. Again? Really?
    miss · miss · miss
    6

    Jump around at random and you’re back to the far shelf every time — miss after miss.

The tools you reach for most go in the apron pocket; the far shelf is for the rest. Nearer means faster.
Semicolony semicolony.dev/eli5/cpu-cache/comic
← All ELI5 explainers