L1 Vs L2 Vs L3 Cache

Generally L1, as it's the first level between the processor and the slow memory subsystems. There is no rule for how many levels of cache there need be, and they are not all implemented in the same fashion, yielding different performance from one architecture to another, so you might as well look at overall performance of the processor in the specific tasks you want to target, instead of basing your decisions on cache alone. There should be plenty of benchmarks around the web to show what you're looking for.
 


They all serve different purposes

The L1 cache is accessed on every instruction cycle as part of the instruction pipeline and is broken into separate instruction and data caches. Thus, the design of the L1 cache should be to maximize the hit rate (the probability of the desired instruction address or data address being in the cache) while keeping the cache latency as low as possible. Intel uses an L1 cache with a latency of 3 cycles.

The L2 cache is shared between one or more L1 caches and is often much, much larger. Whereas the L1 cache is designed to maximize the hit rate, the L2 cache is designed to minimize the miss penalty (the delay incurred when an L1 miss happens).

For chips that have L3 caches, the purpose is specific to the design of the chip. For Intel, L3 caches first made their appearance in 4 way multi-processor systems (Pentium 4 Xeon MP processors) in 2002. L3 caches in this sense greatly reduced delays in multi-threaded environments and took a load off the FSB. At the time, L3 caches were still dedicated to each single core processor until Intel Dual-Core Xeon processors became available in 2006. In 2009, L3 caches became a mainstay of the Nehalem microprocessors on desktop and multi-socket server systems.
 


Pinehdd has a good explanation of what each level of cache does. I will add that L3 cache is mainly a benefit to large multiprocessor servers, which is why it first showed up in 4+ socket servers and has been present in every new 4-socket x86 server CPU made since 2008. That is also why the 4+ processor CPUs have the most L3 cache (16-30 MB at the present time), the 2-processor CPUs have the next highest amount (8-20 MB), and single-socket has the least L3 (15 MB maximum, usually 3-8 MB) if it even has any. It is of much less benefit to single-socket CPUs which is why not all desktop CPUs have it. Intel uses the L3 cache for inter-core communication in Nehalem and later CPUs. AMD uses a crossbar and only has L3 cache in parts like the FX which are derived from server dies.

In short, there is no significant difference in CPU performance in any particular line of CPUs due solely to amount of cache as the amount of cache rarely varies in a product line. For example, all AMD CPUs have the exact same amount of L1 cache/core and all new Intel CPUs have the same amount of L1 and L2 cache per core. You will have other features vary such as clock speed, core count, and "go-fast" features like Turbo Boost that differ between product lines that make a much, much larger difference than cache sizes and for AMD chips, the presence or absence of L3 cache.
 

TRENDING THREADS