Index

Module 02 · How Computers WorkThe machine runs a program

The Memory Hierarchy (cache, locality, the memory wall)

The Memory Hierarchy
The Memory Hierarchy · Open board

The small, fast copies of memory a CPU keeps close, stacked in front of the huge, slow warehouse everyone calls RAM. Follows The CPU (fetch-decode-execute, the ISA, assembly), which left open how far the fetch step reaches for its data; this lesson is that gap, and the one thing you control about it.

Before you start. The CPU (fetch-decode-execute, the ISA, assembly) gave you the loop: fetch, decode, execute, using registers built into the chip. Almost every step eventually needs data from outside the chip, and how far away that data lives is the whole subject here. If a linked list is new, Linked Lists, Stacks & Queues in DSA shows it in one read.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

Same data, same O(n), four access patterns. Why is one of them 31 times slower?

Pick Following a chain of pointers, drag Memory the loop walks from end to end, and watch The bill jump.

Open The memory hierarchy →

Related paper

Review How Computers Work →

Saved in this browser, and to your account when you sign in.