CPU cache is a special high-speed memory that reduces the time the CPU takes to access data. By using high-speed static RAM (SRAM) and because the cache is often located directly on the CPU , CPU cache can be faster than accessing information from dynamic RAM (DRAM) modules. However, it will be limited in storage capacity when compared to DRAM. Cache is divided into levels :
Level 1 cache
L1 cache is built into the CPU and gives fast access to the most frequently used data. This level of cache is the first one accessed by the CPU and is usually found in small amounts. However, it is the fastest cache to be found, offering the lowest latency of any of the types of cache. One of the reasons for this is that it resides within the CPU core. The Core i7-5820K (used in AV Editor) has 6 × 64 KB of L1 cache—64 KB for each of its six cores. You can find more information about multicore technology later in this chapter. In comparison, the Core i5-2400 CPU (used in Media PC) has 4 × 32 KB of L1 cache—32 KB for each of its four cores.
Level 2 cache
L2 cache is usually built on to the CPU (on-die). It is accessed after L1 cache and it serves the CPU with less frequently used data in comparison to L1 but it is still more frequently used data than the data that comes from typical DRAM. L2 cache feeds the L1 cache, which in turn feeds the CPU. L2 cache is not as fast as L1 cache but is far superior to DRAM. This and L3 cache take up the majority of the CPU’s real estate. The Core i5-5820K has 256 KB per core, for a total of 1.5 MB of L2 cache. The Core i5-2400 CPU also has 256 KB per core, for a total of 1 MB L2 cache
Level 2 cache
L3 cache comes in the largest capacities of the three types of cache and has the most latency; therefore, it is the slowest. If the CPU can’t find what it needs in L1, it moves to L2 and finally to L3. Or you could think of it this way: L3 cache feeds L2 cache, which feeds L1 cache, which in turn feeds the CPU with data. If the CPU can’t find the data it is seeking within cache, it moves on to the DRAM sticks. L3 cache could be on-die or on-board, but most of today’s CPUs have it on-die; however, it is shared among the cores of the CPU. The Core i7-5820K has 15 MB of L3 cache. The Core i5-2400 has 6 MB of L3 cache.