- CPU cache memory is a type of temporary data storage located on the processor
- It is used to increase the processing efficiency of the CPU by holding small, often-requested bits of data ready to be accessed at high speeds
- Most modern day processors have multi-level caching, namely
l1
,l2
,l3
and optionall4
CPU cache wasn't always a thing
- The 8008 core (shown in CPU Core) does not have L1 and L2 cache!
- The 8008 core was introduced in April 1972
- The concept of caches became mainstream only around 1980s
L1 and L2 Caches
- Each modern day CPU core has it’s own L1 cache and optional L2 cache
- Registers are located right next to the ALU
- L1 is a little father from the ALU than registers, L2 is even farther
- L1 cache is split,
- L1i is the instruction cache
- L1d is the data cache
Comparison btw registers, L1 cache and L2 cache (off-core)
Parameter | Registers | L1 Cache (on-core) | L2 Cache (off-core) |
---|---|---|---|
Number of CPU cycles to read the value | 1-2 | 4+ | 10+ |
Typical size | 1 KB | 8 - 128 KB | 256 KB - 8 MB |
Managed by | Compiler | Hardware | Hardware |
Technology | CMOS | SRAM | SRAM |
L3 cache
- A shared storage pool that the entire processor can access
- It’s only twice as fast as the RAM but is bigger than L1 and L2
- Commonly L3 caches are 32 MB or more in size
- When first developed, L3 cache was often located in a separate chip on the motherboard. Modern CPUs now almost exclusively have L3 cache onboard for greater efficiency.