Cache Feature Image

What is CPU Cache?

The amount of memory that is stored on the CPU itself—either directly in each core or shared across some or all cores—is known as cache. It is a small portion of dedicated memory that resides on the processor, saving your CPU from constantly accessing your system RAM to retrieve data. Every processor has a tiny amount of cache, ranging from a few kilobytes to many megabytes (depending on the size of the CPU).

Although the cache solves a big problem (as explained below), its biggest downside is its size, both physical and capacity-wise. The cache is physically quite large when compared with other components present on the motherboard, while its capacity is very little. In addition, processor manufacturers have successfully been able to reduce the size of cores and other components with each new model, but have failed to do so with the cache, which is why the cache has become an expensive component to manufacture and this is why the cache, generally, has such a low capacity.

The need for Cache

During the 1990’s, the speed difference between the processor and RAM would enlarge whenever a new generation of processor or RAM was introduced. This was due to the fact that processor manufacturers were determined to increase the speed of the processors while RAM manufacturers were determined to increase the size and thus a speed difference came into existence. The speed difference hurt the processor manufacturers more than it did the RAM manufacturers as the processors performance was being limited by the speed of the RAM. In order to compensate for the speed difference, a cache was introduced.

Cache types

A CPU cache consists of three levels:

  • Level 1: Also known as the primary cache, is embedded on the processor itself and is very fast but the storage size is small as compared to level 2 and 3.
  • Level 2: Also known as the secondary cache, may be found on the processor or as a separate chip on the motherboard. If it is a separate chip then a high speed bus (cable) is used to connect the cache to the processor.
  • Level 3: This is a specialized memory, primarily installed to boost the speed of level 1 and 2 caches. This level isn’t faster than the aforementioned two, however it is almost twice as fast as a DRAM (around 120 to 200 nanoseconds). In a multicore processor, every core has a level 1 and 2 cache but they all share the same level 3 cache.