Table of Contents

About

A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory.

When the processor needs to read from or write to a location in main memory, it first checks whether a copy of that data is in the cache. If so, the processor immediately reads from or writes to the cache, which is much faster than reading from or writing to main memory.

See Memory - Hierarchy

Type of CPU cache

Most modern desktop and server CPUs have at least three independent caches:

  • an instruction cache to speed up executable instruction fetch,
  • a data cache to speed up data fetch and store,
  • and a translation lookaside buffer used to speed up virtual-to-physical address translation for both executable instructions and data.

Level

L3 caches are almost always shared amongst cores; L2 and L1 might also be shared.

L1

Level 1 (L1) cache is the primary cache – often accessed in just a few cycles, usually tens of kilobytes. The L1-cache is the fastest cache and it usually comes within the processor itself.

The L1 cache uses the high-speed SRAM (static RAM) instead of the slower and cheaper DRAM (dynamic RAM) used for main memory.

L2

Level 2 (L2) cache – higher latency than L1 by 2× to 10×, often 512 KiB or more.

L2 cache comes between L1 and the main memory and is bigger than the L1 cache.

L3

Level 3 (L3) cache – higher latency than L2, often 2048 KiB or more.

L3 caches are found on the motherboard rather than the processor. It is kept between RAM and L2 cache.

Documentation / Reference