Modern CPUs run incredibly fast; they can significantly outperform the system RAM.

How does a CPU cache speed up a CPU?

The CPU cache has its speed optimised in three ways: latency, bandwidth, and proximity.

Article image

In comparison, the latency of modern high-speed RAM is on the order of 14 nanoseconds.

In terms of bandwidth, the CPU cache offers significant performance improvements over traditional storage and RAM.

Each individual CPU core in a multi-core CPU has its own L1 cache.

It is typically split into two portions, the L1I and L1D.

Each CPU core typically also has its own L2 cache on a modern CPU.

By having a dedicated L2 cache per core, cache contention is avoided.

The L3 cache is typically shared between all the CPU cores of the processor.

Again, the L3 cache is slower than the L2 cache but is cheaper and larger.

How is the CPU cache used?

All levels of the CPU cache are used to speed up processor performance by caching data from RAM.

If the data is found in a cache hit, then the CPU can continue its processing.

The faster layers are always checked first for maximum performance.