the translation lookaside buffer (TLB)
/ TEE-ell-BEE /
Picture the receptionist who, instead of flipping through the whole directory every single time, keeps a sticky note on the desk with the last few room-to-location lookups they did — because visitors keep asking about the same handful of rooms. The translation lookaside buffer is exactly this sticky note: a small, very fast hardware cache that remembers recent virtual-page-to-physical-frame translations, so most accesses can skip the slow page-table lookup entirely.
Concretely, the TLB is a small associative cache (often just dozens to a few thousand entries) sitting inside the MMU. On each memory access, the hardware presents the virtual page number to the TLB. If there is a match — a TLB hit — the physical frame number and protection bits come back in a cycle or two, and translation is essentially free. If there is no match — a TLB miss — the hardware (or the OS) must walk the page table in memory to find the translation, then install it in the TLB for next time. Because programs exhibit locality, the same pages are touched again and again, so TLB hit rates are typically very high (well above 99 percent).
Why it matters: without the TLB, every memory reference would require extra memory references just to read the page table, easily doubling or tripling memory traffic — translation would dominate. The TLB is what makes virtual memory affordable in practice. The honest caveats: the TLB has limited reach (entries times page size), so programs with large or scattered footprints suffer many TLB misses; a context switch may flush the TLB (or rely on address-space tags to avoid it); and a TLB miss, while far cheaper than a page fault, is still a real, measurable cost that good code tries to minimize.
A loop sweeps through one 4 KiB page 1000 times. The first access misses the TLB and walks the page table; the next 999 all hit the TLB and translate in a cycle or two — locality turned into speed.
First touch misses; repeated touches of the same page hit the TLB and translate near-free.
Large pages (e.g. 2 MiB 'huge pages') exist partly to extend TLB reach: one entry covers far more memory, so big data structures cause fewer TLB misses — a real tuning knob for high-performance code.