# CPU Cache

> Tiny fast memory inside the chip. It saves slow trips out to RAM.

**Field:** Infrastructure  
**Category:** Hardware  
**Also known as:** Processor Cache, L1 Cache, L2 Cache, L3 Cache

## Think of it like

Think of it like a small shelf by the cook's hands. The big pantry is far away.

## Definition

A CPU cache is a small, very fast memory built into the processor chip. It keeps copies of the data the cores used last. Reading from the cache is far quicker than going out to RAM. It comes in levels. L1 is the smallest and fastest, then L2, then L3, which the cores often share. When a core needs data that is not in the cache, it has to wait for RAM.

## Example

Lucy's program adds up a long list of numbers that sit side by side in memory. Each trip to RAM brings in a block of them, so the next few come from the cache.

## Why it matters

A core that waits for RAM does no work. Code that reuses nearby data stays in the cache and runs much faster.

## Common mistake

Thinking more RAM makes the cache bigger. The cache is built into the chip, and nothing can be added to it.

## Three principles

- **Inside the chip.** It sits right beside the cores.
- **Levels.** L1 is smallest and fastest, then L2, then L3.
- **A miss costs time.** The core waits while RAM sends the data.

## Related terms

- [Central Processing Unit (CPU)](https://learn.benibix.com/term/infrastructure/central-processing-unit)
- [CPU Core](https://learn.benibix.com/term/infrastructure/cpu-core)
- [Random Access Memory (RAM)](https://learn.benibix.com/term/infrastructure/random-access-memory)
- [Memory Bandwidth](https://learn.benibix.com/term/infrastructure/memory-bandwidth)
- [Cache](https://learn.benibix.com/term/development/cache)

## Taught in

- [CPU Cores and Clock Speed](https://learn.benibix.com/learn/infrastructure-hardware/cpu-cores-and-clock-speed): Computer Hardware, 2/8

![One processor chip holding four core boxes. Each core has a small L1 and L2 cache beside it. A wide L3 cache bar runs under all four cores, and a clock line of ticks runs along the top.](https://learn.benibix.com/diagrams/inf4-cpu-inside.svg)

---

Source: https://learn.benibix.com/term/infrastructure/cpu-cache
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
