HomeToolsAbout

Cache

What is CPU Cache

CPU Cache exists so your CPU doesn't need to fetch information from your system RAM every time.

It's all about reducing latency by being closer physically to the processor.

Levels of CPU Cache

CPU has L1, L2, and L3 caches.

L1 Cache

L1 is the smallest in size.

Usually divided into L1 instruction (L1i) and L1 data (L1d).

Each core within CPU has its exclusive chunk of L1 cache.

  • typically only a few kilobytes large.

The data store in L1 is something CPU just used or expects to use immediately.

L2 Cache

L2 cache is typically exclusive to a single CPU core, but in some CPUs, they are shared between multiple cores.

L2 cache is much larger than L1 cache.

For example, each P-core in the Core i9-12900K has 80 kilobytes of L1 cache, as well as 1.25 megabytes of L2 cache, nearly 16 times as much.

The tradeoff of slower (higher latency) matters.

L3 Cache

If a CPU can't find a requested data in L2 cache, it asks L3 cache.

L3 cache is shared between some or all cores within a CPU and it's big.

The 7950X3D, for example, has 128MB of L3 cache with its bolted-on 3D V-Cache, while it only has 16MB of L2 cache.

When there is a cache miss at L3 level, the CPU needs to communicate with a RAM.

Except for storage, RAM has the worst speed and latency in the memory hierarchy, and whenever the CPU needs to access the RAM for required data, things can grind to a halt.

L4?

Some CPUs even have L4 cache, but it usually functions as RAM that’s on the CPU package.

AboutContact