When choosing a CPU, most people focus on core counts and clock speeds — which makes sense since they have a big impact on performance. However, the cache is also a component of your CPU. There are different cache levels. This article will explain how the L2 cache works and how it compares to its L1 and L3 counterparts.
Key Takeaways
- L2 cache is a form of temporary storage that reduces the latency between CPU-RAM operations.
- It is larger but slower than the L1 cache and also further away from the microprocessor than the L1 cache.
- L2 cache size varies from 2.5 MB to 32 MB (or even more) in modern CPUs.
What Is CPU Cache
Before I explain L2 cache, you need to know what CPU cache is in general. CPU Cache[1] is a form of temporary storage that fetches data (from system memory, or DRAM) and stores it in its own memory for faster access. This memory is termed Static RAM[2] or SRAM.
CPU cache is much faster than DRAM; however, it’s also much more expensive. There are three types or “levels” of cache: L1, L2, and L3. These levels are differentiated based on their distance from the CPU microprocessor, speed, and size.
What Is L2 Cache
L2 cache (also called secondary cache) is the second level of CPU cache. This means that it is further away from the CPU than the L1 cache (although both are found in the CPU package in modern processors). The L2 cache is also larger in size and capacity than the L1 cache[3].
The SRAM used in the L2 cache is about 25 times faster than DRAM[4]. Regarding size, the L2 cache varies in modern CPUs, from about 2.5 MB (for entry-level CPUs) to 32 MB for high-end CPUs[5].
How Does L2 Cache Work?
As explained, the cache is a temporary storage from which the CPU can access data more quickly than it can from the DRAM, reducing latency. Thus, it acts as a bridge between the CPU and the RAM[6]. This obviously applies to the L2 cache (along with L1 and L3).
CPUs take important data from DRAM and store it in the cache (a process called prefetching). The data travels from the DRAM to the CPU cache through the system bus[7], as visualized above. The cache that receives it may be L2 (it could also be L1 or L3). Thus, the CPU now has faster storage to access data when needed.
When the CPU needs to access prefetched data, it searches for it in the L1 cache, as it’s the closest one. If it does not find the data there (cache miss[8]), it looks for the data in the L2 cache. Assuming the data is found in L2, it is used by the CPU to perform the necessary task — a cache hit[9]. If it does not find the data in L2, it repeats the same process for L3.
Why More Cache Is Better
More cache is always better as the CPU has access to more high-speed memory to store instructions temporarily. This is why CPU manufacturers attempt to fit as much of this tiny memory into their CPUs as possible.
A CPU with more L2 cache will perform better than that with less L2 cache, provided the rest of the specifications of the CPU don’t alter the outcome of the comparison.
L2 Vs L3 Cache: What’s The Difference?
You’ve already learned that the three CPU cache levels differ in size, speed, and distance from the CPU. The L2 cache is closer to the microprocessor than the L3 cache[10]. It is also faster than the L3 cache and, at the same time, is found in less capacity in CPUs compared to the L3 cache.
Furthermore, each core has a specific amount of L2 cache. There may be two pools of L3 cache in CPUs with higher core counts, such as the Ryzen 9 5950X, which has 16 cores; each set of 8 cores shares 32MB of L3 cache.
Final Thoughts
L2 cache is an essential component of CPUs and reduces the latency between the CPU and DRAM. However, the L2 cache count isn’t the sole specification you should look at in a CPU when deciding on the right option.
CPU core counts and clock speeds should be your primDontary focus. If you choose a CPU with the ideal core counts and clock speeds, it’s likely the CPU already has the right amount of L2 cache to go with it.
Related Helpful Resources By Tech4Gamers:
References:
- Basics of Cache Memory
- SRAM TECHNOLOGY
- Caches & Memory
- Difference Between SRAM and DRAM
- Cache Memory
- Cache Performance
- Overview of Computer Busses
- Cache Miss
- Cache Hit
- Memory
Frequently Asked Questions
L2 cache reduces the latency between the CPU and the memory by providing much faster temporary storage for the CPU to access data quickly.
L2 cache is a vital component of CPUs as it provides high-speed memory for the CPU to store instructions in. Thus, a good amount of L2 cache is crucial for gaming.
L2 cache is faster but less capacious than L3 cache. Also, the L3 cache is typically in the form of a “pool” shared by multiple cores, while each core has its own L2 cache.
Thank you! Please share your positive feedback. 🔋
How could we improve this post? Please Help us. 😔
Feedback By:
Nkosinathi
[Wiki Editor]
Ali Rashid Khan is an avid gamer, hardware enthusiast, photographer, and devoted litterateur with a period of experience spanning more than 14 years. Sporting a specialization with regards to the latest tech in flagship phones, gaming laptops, and top-of-the-line PCs, Ali is known for consistently presenting the most detailed objective perspective on all types of gaming products, ranging from the Best Motherboards, CPU Coolers, RAM kits, GPUs, and PSUs amongst numerous other peripherals. When he’s not busy writing, you’ll find Ali meddling with mechanical keyboards, indulging in vehicular racing, or professionally competing worldwide with fellow mind-sport athletes in Scrabble at an international level. Currently speaking, Ali has completed his A-Level GCEs with plans to go into either Allopathic Medicine or Business Studies, or who knows, perhaps a full-time dedicated technological journalist.
Get In Touch: alirashid@tech4gamers.com