The word "cache" may have popped up in your conversations about computers, performance, and – more specifically – memory. But what does it really mean and why does it matter?
Understanding cache and cache memory can help you make the best choices for maintaining your computer, so you can keep doing tasks at maximum efficiency. In this guide, you’ll learn what cache memory is and how it affects your daily computer use.
Computer cache definition
Cache is the temporary memory officially termed “CPU cache memory.” This chip-based feature of your computer lets you access some information more quickly than if you access it from your computer’s main hard drive. The data from programs and files you use the most is stored in this temporary memory, which is also the fastest memory in your computer.
Cache vs RAM
When your computer needs to access data quickly, but can’t find it in the cache, it will look for it within the
random access memory (RAM). RAM is the main type of computer data storage that stores information and program processes. It’s farther away from the CPU than cache memory and isn’t as fast; cache is actually 100 times faster than standard RAM.
If cache is so fast, why isn’t all data stored there? Cache storage is limited and very expensive for its space, so it only makes sense to keep the most-accessed data there and leave everything else to RAM.
Other uses of the term “cache”
"Cache" is also used to refer to any temporary collection of data, either in hardware or software. For instance, regular maintenance suggests you restart your computer, router, and modem on a regular basis to “clear the cache,” letting your devices load programs faster. When you go to your Google history to erase your browser cookies and search, one of the options is to clear “cached images.”
When techies in computers talk about the "cache," they are most likely referring to cache memory.
How cache memory affects performance
How does the cache make your computing faster? We already know that it can access frequently-used data with peak efficiency. Deciding what data it stores in the cache, however, is almost an art in itself.
The computer waits for you to use data, then catalogs a copy of the data you access over and over into its special cache memory library. This process is called “caching.” The more you use something, the more likely a copy of it will end up in your cache.
Hits and misses
Then, when you perform a task that requires that information, the computer checks the cache memory first. If it’s there, it’s called a “hit,” and you’ll achieve peak performance. If the data isn’t there, it’s a “miss,” and your PC will take the longer and slower route of looking for it in your hard drive or RAM.
What if my cache is full?
As much as caching can help speed up a computer, if the memory cache gets too full, it can slow you down instead. It’s important to run maintenance tasks on your PC because some of these functions will rid its memory of temporary files it likely doesn’t need anymore. The same applies to your internet browser, which stores even more data in a cache that can bog down your PC. If you’re overdue for
clearing your browser history or temporary internet files, don’t delay.
Cache levels explained
There isn’t just one big bucket of cache memory, either. The computer can assign data to one of two levels.
Level 1 cache
Level 1 (L1) is the cache integrated into your CPU. It assesses the data that was just accessed by your CPU and determines that it’s likely you’ll access it again soon. So, into the L1 cache it goes, because this is the first place your computer will check the next time you need this info. It’s the fastest of the cache levels.
Level 2 cache
Level 2 (L2) is also called the “secondary cache.” It’s where your computer goes when it can’t find your data (or gets a “miss”) after looking in the L1 cache. Level 2 is usually on a memory card in close proximity to the processor.
Disk cache
You will also find cache memory on the hard drive. This is called a “disk cache.” It’s the slowest of all the cache levels, as it takes data from the hard drive to put on the RAM. The RAM may also store information for computer accessories and peripherals, like the DVD drive, in a peripheral cache.
GPU cache
Obtaining the necessary data to render graphics must happen very quickly, so it only makes sense that it uses a cache system. If your computer’s graphics are integrated, they will be handled by a graphics processing unit (GPU) that’s combined with a CPU in one chip. Both functions work from the same resources, so the GPU cache is limited, too.
A separate,
dedicated graphics card (also called “discrete graphics”) will be separate from the CPU and also come with its own memory cache. The fastest gaming computers will have a dedicated graphics card with adequate cache stores built right into the GPU to avoid lag or stutter with intense games.
How to buy with cache in mind
Most people don’t shop for a new computer thinking about the cache. However, it’s worth noting if you’re interested in having the smoothest computer experience with less lag and fewer delays, especially when running multiple processes at once. Additional cache memory considerations include the size of the cache and the latency.
Size
Yes, it’s true that a larger cache holds more data. But it’s also slower, so there’s a trade-off in performance. Also, computers are built to prioritize data into different caches. That’s why they have cache levels. If there’s not enough room in the L1 cache, it can store it in the L2 cache. As a result, cache size shouldn’t be the main consideration when shopping.
Latency
For the purposes of accessing data, think of latency as “speed.” How long does it take your PC to get to that L2 memory cache? If it’s a smaller cache, it’ll be quicker. A 6MB L2 cache will have increased latency compared to a 3MB cache. Higher end computers use a multisystem approach that places data across additional smaller caches. This solves the problem of holding more information with better overall latency.
Conclusion
With all the specs you need to consider when buying a computer, your buying decision probably won’t hinge on cache alone. You’ll shop for the CPU or GPU, instead, since that’s where the cache processes occur.
With so many other considerations that have a bigger impact on the overall CPU performance, these will likely drive your purchase far more than cache. As you shop for a CPU, consider the price, clock speeds, the number of cores, the number of threads, and compatibility with your motherboard or graphics card. For more info about shopping for your CPU, check out our article on
the best CPUs for business or
the best CPUs for gaming.
While it helps to know how the cache works, if you’re buying a high-end gaming computer or business laptop, you'll likely obtain access to the best-performing cache memory options by default. If you are planning to upgrade your CPU, you can factor in the cache when you choose which CPU is right for your computer.
About the Author
Linsey Knerl is a contributing writer for HP® Tech Takes. Linsey is a Midwest-based author, public speaker, and member of the ASJA. She has a passion for helping consumers and small business owners do more with their resources via the latest tech solutions.
Popular HP Products