Skip to content
BENIBIX Learn

CPU Cache

Infrastructure🔧 HardwareProcessors

Also known as Processor Cache, L1 Cache, L2 Cache, L3 Cache

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

Think of it like

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

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.

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.
L1 and L2 sit beside each core. The bigger L3 below is shared by all of them.

Common mistake

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

Key takeaways

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

Learn it properly