The problem › One number, two meanings
“How fast is your memory?” is two questions
Chapter 0.2 left us with DRAM: dense, slow, and dealing in bursts. But slow how?When someone says memory is "fast," they are smuggling two completely different claims past you. The architecture texts keep the two words strictly apart: latency (or response time) is the time between the start and the completion of one event: one load, one disk access. Bandwidth (or throughput) is the total amount of work done per unit time, bytes per second once the stream is flowing.
Latency is the length of the pipe, paid once per request. Bandwidth is the widthof the pipe, a steady-state rate. They are set by different physics, they improve at wildly different rates, and they are bought with different money. This is the first idea of the course's spine, latency ≠ bandwidth ≠ capacity, and from here to the last chapter on LLM decoding, confusing them is the most expensive mistake you can make.
The classic proof that they are independent: a station wagon full of backup tapes hurtling down the highway (Tanenbaum's formulation). Terabytes arrive: colossal bandwidth. But the first byte takes a day. Nobody wants to play a video game over a station wagon, and nobody wants to ship a datacenter's backups over a phone line. Different jobs bind on different numbers.
The two numbers are so unlike each other that they are not even measured the same way. Latency is measured with dependent loads: pointer chasing, where each 64-byte line holds the address of the next, so no access can begin until the previous one returns; the chain forces you to feel every round trip. Bandwidth is measured with independent streaming loads whose results feed nothing, so the hardware is free to overlap as many as it can. Hold on to that asymmetry: dependence exposes latency, independence buys bandwidth. It is the mechanical heart of chapter 0.9 and of every GPU in Topic 1.
SourcesCAQA 6e §1.4 · pp. 20–21Bakhvalov 2e §4.10 · pp. 88–91CS:APP 3e §6.1 · pp. 617 ff.
The mechanism › The one equation
Time = latency + bytes ÷ bandwidth
For a single transfer of N bytes, the total time is one pipe-length wait plus the flow time:
T(N) = latency + N / bandwidth
Two regimes hide in that sum. When N is small, the second term vanishes and latency is the whole bill: ask for 64 bytes from DRAM (90 ns away, 76.8 GB/s wide on our reference Intel Core i9-12900K) and the transfer itself contributes a laughable 0.8 ns. When N is large, the first term vanishes and bandwidth is the whole bill: stream 64 MB and the 90 ns you waited up front rounds to nothing.
The border between the regimes is worth knowing by heart: N* = latency × bandwidth, the number of bytes the pipe could have carried during one wait. For our reference DRAM that's 90 ns × 76.8 bytes/ns ≈ 6.8 KB. Transfers much smaller than N* are latency's hostages; transfers much bigger are bandwidth's. Hardware designers call this quantity the bandwidth-delay product, and every trick in this course, from cache lines and DRAM bursts to GPU coalescing and KV-cache batching, is an attempt to stop paying pipe-length prices for sub-N* payloads.
Predict first
Fetching one 64 B cache line from DRAM takes ≈ 91 ns. How long to fetch 64 KB, a thousand times more data?
interactive · coming soon
PipeSim: length vs width
Planned interactive: two independent sliders, pipe length (latency) and pipe width (bandwidth), against a transfer of N bytes. Watch total time flip from latency-dominated to bandwidth-dominated as N crosses N*, and find the crossover yourself before the sim draws it.
The mechanism › Why the gap keeps growing
Bandwidth is for sale; latency mostly isn't
Here is the asymmetry that shapes the next forty years of hardware (and chapter 0.4): bandwidth improves much faster than latency. CAQA's milestone data across four decades of technology puts numbers on it: microprocessors and networks gained 32,000–40,000× in bandwidth but only 50–90× in latency; main memory and disks gained 400–2,400× in bandwidth against a pitiful 8–9× in latency. The book distills it into a rule of thumb worth memorizing verbatim: "bandwidth grows by at least the square of the improvement in latency."
The reason is structural, not accidental. Bandwidth is parallelism: add wires, add channels, add banks (0.2), run the bus faster. That means you can buyit with transistors and pins, which is exactly what Moore's law kept handing out. Latency is a round trip through physical distance, wire capacitance, and DRAM sense-amplifier settling (0.2 again), none of which shrink on demand. One improves like a budget; the other like a law of nature. The trend lineage runs through Patterson's 2004 essay, aptly titled Latency Lags Bandwidth.
Consequence: hardware increasingly spendsbandwidth to hide latency, fetching 64 bytes when you asked for 4, prefetching lines you haven't requested yet, running thousands of GPU threads so someonealways has data in flight. Once you see "burn width to hide length" as a move, you will recognize it in every chapter that follows.
SourcesCAQA 6e §1.4, Fig. 1.9 · pp. 20–21
The mechanism › What a real machine measures
Idle latency, loaded latency, and the bandwidth you can't reach alone
On real silicon the two numbers split further, and the splits are instructive. The ~90 ns we quote is idle (or unloaded) latency: one polite pointer-chase on an otherwise quiet machine. Under load, with other cores hammering the same memory controller, requests queue, and observed latency climbs well above idle; the quoted number is a floor, not a promise.
Bandwidth has the mirror-image caveat: one core cannot reach it alone. On Bakhvalov's measured Alder Lake (i7-1260P, DDR4-2400, 2 channels), a single P-core sustains about 25 GB/s from DRAM while the theoretical maximum is 38.4 GB/s; it takes all the cores together to push ~34 GB/s.Why can't one core do it? Because bandwidth is only realized by keeping many transfers in flight at once, and a single core can track only so many outstanding misses. The number of in-flight bytes needed is our friend N* wearing its other hat: this is memory-level parallelism (MLP), and its shortage on a single thread is precisely the opening a GPU exploits with ten thousand threads (Topic 1).
Same idle latency, same DIMMs, yet three different numbers depending on how you ask: dependent chain (90+ ns per access), one streaming core (~⅔ of peak), every core streaming (~90% of peak). A spec sheet gives you two scalars; the machine gives you a surface. Bakhvalov's advice after measuring his own laptop: memorize your machine's hierarchy numbers; they are the mental model every later analysis leans on.
The number › Your turn
Two transfers, two regimes
Compute the number › 64 B vs 64 MB from DRAM (Intel Core i9-12900K)
| DRAM idle latency (paid once) | 90 ns |
| bandwidth | 76.8 GB/s = 76.8 bytes/ns |
| 64 B: transfer term | 64 ÷ 76.8 ≈ 0.8 ns |
| 64 B: total ≈ latency | 90 + 0.8 ≈ 91 ns (~99% latency) |
| 64 MB: transfer term | 67,108,864 ÷ 76.8 ≈ 874 µs |
| 64 MB: total ≈ transfer | 874 µs + 90 ns (latency ≈ 0.01%) |
| Result | same memory, same request: one bill is ~99% latency, the other ~99.99% bandwidth |
One machine, one DRAM, one equation, and the cost structure of a small access has nothing in common with a large one. Whenever you meet a new memory system, compute N* first; it tells you which number that system will make you care about.
The full story › capacity, the third number
The spine says latency ≠ bandwidth ≠ capacity, and capacity is the quiet one: how many bytes fit. Chapter 0.2 showed why capacity trades against speed at the level of transistors, and capacity has its own trend trouble: DRAM density, which historically quadrupled every three years, has slowed to a crawl (8 Gb chips shipped in 2014; 16 Gb didn't arrive until ~2019; 32 Gb may never come in planar DRAM). The three numbers form the axes of every memory technology you will ever evaluate: L1 (tiny, instant, torrential), DRAM (big, distant, wide), NVMe (huge, glacial, respectable). No technology wins more than two. Also deferred here: concurrency. Real systems approach peak bandwidth only with many transfers in flight (Little's Law: outstanding bytes = latency × bandwidth, N* again). That idea returns as memory-level parallelism in 0.9 and as the entire reason GPUs work in Topic 1.
Latency is the pipe's length; bandwidth is its width; they are priced, improved, and paid separately, with bandwidth growing at least as the square of latency's improvement. T(N) = latency + N/bandwidth, and the crossover N* = latency × bandwidth decides which one owns your transfer. Burn width to hide length; you'll watch every layer of the stack make that trade from here on.