This might be on the more technical side for this blog, however, I often get asked by friends or family about cache memory. This discussion often comes up when the person is trying to purchase a new computer or possibly even a CPU. So, I figured it would would make for a good discussion topic on this blog.
Cache Memory: What is it?
Cache Memory is much like RAM. It is memory that the CPU uses to store information. However, the difference is that cache memory is closer to the processor core(s) and smaller in size. This makes cache memory much faster than RAM.
As the CPU processes data, it looks first in the cache memory and if it finds the data in the cache, it does not have to do the more time-consuming reading of data from larger memory. Often times, the cache will contain pieces of data that are being used frequently by the CPU. This makes access to these frequently used pieces of data much more efficient.
One more thing to note is that the cache memory, for most chips today, is physically on the same chip as the CPU. So, if you were to open up your computer and take out the processor chip, the cache memory would all be on that chip.
L1 Cache, L2 Cache, and L3 Cache
Most computers these days have at least an L1 and L2 Cache. Some even have a 3rd level of cache which is appropriately labeled L3. For the average computer user, all that you really need to know about these is that the L1 Cache is the fastest, L2 is the 2nd fastest, and so on. The speed of these memory banks has to do with the size of these particular caches and the proximity of this storage to the processor(s).
Cache Size and Performance
Generally speaking, a larger cache means better performance. Keep in mind that there are diminishing returns when you go for a larger cache. For example, a 1MB cache is not double as fast as a 512KB cache.
The performance of a particular CPU is truly dependent on the architecture of the chip. If you really want to see how CPUs and their caches stack up to each other, I would recommend checking out benchmark tests comparing different CPUs. When a chip maker designs their CPU and cache memory structure, they are taking all variables into account. So, when you are trying to choose a CPU, you should really look at the finished product, not just cache sizes.