Quick Links

Key Takeaways

The main differences between L1, L2, and L3 cache memory are are capacity and transfer speed. L1 is low capacity but extremely fast, L2 is slower but has more storage space, and L3 is the slowest of the three but also usually has the biggest storage capacity.

Modern computer processors all use a multi-level cache memory system that allows data to be temporarily stored on the chip for quick access. Understanding the differences between L1, L2, and L3 cache can be important if you want the best performance from the next CPU you buy.

What is CPU Cache Memory?

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 speed. Cache memory is comprised of different levels of storage. These levels are commonly referred to as L1, L2, L3, and occasionally L4, and vary in location, speed, and size.

To better understand why the CPU needs its own memory cache, we have to look at the development of processors and RAM. The speed difference between the processor and the RAM was minimal in early computers. There was little concern that processing would be slowed down by the memory. As the operating speed of central processors increased far ahead of RAM speed, there was a need to somehow reduce that disparity. The answer was cache memory.

Cache memory is both extremely fast, often between 10 and 100 times faster than DRAM, and physically close to the processor cores. Modern, fast processors aren't slowed down by having to make requests for data from relatively slow system memory because they can get the data from the cache instead.

The reason why this type of memory, known as SRAM, isn't just used in place of the DRAM in a computer comes down to its cost. The amount of cache memory on a CPU is relatively tiny, measured in kilobytes or megabytes rather than gigabytes, and would be prohibitively expensive to make at the same sizes as modern RAM modules.

Cache memory shouldn't be confused with other types of cache commonly found in your computer. Although "cache" can refer to several types of temporary memory storage used to increase the efficiency of software or hardware, cache memory is specific to processor hardware.

What is L1 Cache?

L1 cache, sometimes called Primary Cache, is the smallest and fastest memory level. It is commonly 64KB in size, but each core of the processor has its own L1 cache built in, so a quad-core CPU would have a total of 256 KB.

If you look at memory details in a tool like CPU-Z, you will notice that the L1 cache is split into two further levels: L1-I (instruction) and L1-D (data). The L1 Instruction cache handles information that will be fed to the processor, while the Data cache holds information to be written to the main memory.

viewing L1 cache in CPU-Z

Level 1 cache can transfer data as fast or faster than the maximum operating speed of the CPU, making it extremely efficient. If the processor fails to find the required data in L1, it looks for it in the L2 and L3 cache.

What is L2 Cache?

L2 cache is a secondary memory cache, also embedded within each individual core of the CPU. It almost always has more storage space than L1, but it operates at a slower speed, albeit still much faster than the RAM speed.

Some high-end processors might have a total of 32MB of L2 cache, but 6-12MB is probably the average. As mentioned, this is divided equally between all cores, allowing each to access its own cache independently.

What is L3 Cache?

Rather than being embedded within each CPU core, the Level 3 cache acts as a shared storage pool that the entire processor can access. It is far slower than L1 and L2 cache, perhaps only twice as fast as RAM, but is the largest of all three memory levels.

If the CPU fails to find the data it needs in the cache memory, it must instead request the data from the slower system memory. This is called a cache miss. The introduction of L3 cache reduced the chances of a miss and therefore helped to improve performance.

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.

L1 vs. L2 vs. L3 Cache: What Are the Differences?

The main differences between the three levels of cache memory are size, speed, and where they are located.

  • L1 cache has low storage capacity but is usually the fastest memory in any computer, up to 100 times faster than RAM. Each processor core has its own L1 cache, usually around 64KB.
  • L2 cache may be several times larger than L1 but is only about 25 times as fast as RAM. Like L1, each processor core has its own L2 cache. Each is commonly 256-512KB, sometimes as high as 1MB.
  • L3 cache has the largest storage capacity, often 32MB or more, but might only be twice as fast as the system memory. L3 cache is commonly embedded in the CPU, but separate from the cores.

Can Cache Memory be Deleted?

There are memory caches that can be deleted or cleared, such as system cache or browser cache, but you can't delete CPU cache memory. Just like DRAM, SRAM is volatile memory, which means it doesn't retain its contents in the long term. As soon as you power off the computer, everything in the cache memory is lost.

How Much Cache Memory Do I Need?

As with most types of memory, the more cache a CPU has, the better. You can't upgrade cache memory, so ensuring the processor you choose has enough for your needs is important. That said, it depends on what you do with your computer, and you shouldn't get hung up on this one CPU feature. Clock speeds, number of cores and threads, and other factors can all affect CPU performance.

A good baseline for L1 cache is 64KB per core. You can figure this out by dividing the total amount by the number of cores in the CPU. 256KB of L2 cache per core is perfectly acceptable, but gamers might want to look for 512KB per core. And anything between 32 and 96MB of L3 cache is fine for most purposes.

Related: CPU Basics: What Are Cores, Hyper-Threading, and Multiple CPUs?