Modern CPUs are fast enough that direct RAM access would constantly slow them down.
To reduce this bottleneck, CPUs use multiple layers of acceleration.
Two of the most important are:
TLB → speeds up address translation
CPU Cache → speeds up actual data access
The TLB helps the CPU determine where memory is located.
CPU cache helps the CPU retrieve the memory contents quickly.
The Full Memory Path
When a program accesses memory, several things happen internally.
Program uses virtual address
↓
TLB lookup
↓
Virtual → physical translation
↓
CPU cache lookup
↓
Data returned to CPU
All of this may happen billions of times per second.
Step 1: Address Translation
Programs use virtual addresses, not physical RAM addresses.
Before memory can be accessed, the CPU must translate the virtual address
into a physical address.
Virtual Address
↓
TLB
↓
Physical Address
The TLB caches recent translations to avoid repeated page-table walks.
Fast Path
TLB hit
↓
Immediate translation
Slow Path
TLB miss
↓
Walk page tables
↓
Load translation into TLB
Even before data is fetched, the CPU must first determine where the data lives.
Step 2: CPU Cache Lookup
After translation, the CPU checks cache memory for the requested data.