Hardware → Hardware Building Blocks
CPU Cache
Small, fast memory close to the CPU that reduces the cost of repeatedly accessing main memory.
Motivation
CPU Cache solves the problem of the CPU waiting too long for RAM.
Where it fits
CPU Cache belongs to hardware and memory hierarchy.
Mental model
CPU cache is small, fast memory near the processor that keeps recently or frequently used memory data closer to execution.
Subconcepts
L1 Cache
The smallest and fastest CPU cache level, closest to the execution units.
L2 Cache
A larger but usually slightly slower CPU cache level.
L3 Cache
A larger cache level often shared across CPU cores.
Common mistakes
- Confusing CPU cache with application cache like Redis.
- Assuming cache behavior is always visible to the programmer.
Related concepts
CPU Cache connects to CPU, RAM, memory hierarchy, latency, and locality.