Sign in with
Sign up | Sign in
Your question
Solved

What is CACHE exactly? Not just for CPUs but for other components too

Last response: in CPUs
Share
December 16, 2010 10:01:35 PM

Hey guys. So I was hoping you guys could educate me what a CACHE exactly is and what it does for the parts they're on.

As far as I know, it's something to do with temporary storage. But I'd like to be educated further.

The parts below are examples of parts that have "caches"

CPU - http://www.newegg.com/Product/Product.aspx?Item=N82E168... (Has 8 MB)

HDD - http://www.newegg.com/Product/Product.aspx?Item=N82E168... (Has 32 MB)

Optical Drive - http://www.newegg.com/Product/Product.aspx?Item=N82E168... (Has 2 MB)

So what does the CACHE provide for these 3 parts? What does it do? Go ahead and spill everything you know xD

Are there any other parts that have a cache?

Thanks for your time

More about : cache cpus components

December 16, 2010 10:38:37 PM

That's a good question that I have been wondering myself and I hope to be able to answer it shortly.
m
0
l
Related resources
Can't find your answer ? Ask !
December 16, 2010 10:46:00 PM

I see, well I know what a cache generally is, but Im curious what it does for those 3 specific parts I guess, maybe some real life examples or something.
m
0
l

Best solution

a b à CPUs
December 16, 2010 10:53:47 PM

Lots of components have cache. It's a fairly broad piece of memory technology. In its broadest form, it simply means a central piece of temporary storage used for quicker data access. It can be implemented in a lot more ways than what I'm describing, like with page file caches, or a DNS cache.

The cache you're thinking of is usually a very high speed, if low capacity, static ram module built for use as temporary storage for a device. The static ram cache has the distinct advantage or working apart from the system clock and not having to be constantly refreshed like SDRAM does (SDRAM being your normal main ram). Unfortunately its also very difficult and expensive to make, so its reserved for very specific purposes.

Its exact implementation and use depend on the device its used in.

Processors actually have several different caches, currently its common to see up to three types of caches implemented in a chip, labeled L1, L2, L3. L standing for the "level" of the cache. Some very high end server-processors go much higher, though, up to L12 cache. This level 'hierarchy' of cache is especially important on multi core processors. Each level of cache will usually have a different use, different capacity, and be used for storage for different types of data. There were times when this cache was actually a separate module, but its since been completely integrated on to the CPU die.
Usually the Cache serves as temporary storage for the CPU's required instructions and application data, and also has a 'pre-loading' ability that will attempt to predict what will be needed next and load it into the cache so its readily available when needed. These are systems known as data and instruction "fetching".
A larger Cache can make quite a noticeable difference in performance.

Hard disk cache is vitally important as a means of compensating for latencies between the CPU and the Hard disk. This uses a similar 'pre-loading' type principle present on CPU cache to have DATA ready for Read/Write operations on a moments notice. Like with the CPU, the more cache the better, as you will have more data ready without having the components needing to wait on each-other. A diminishing returns curve tends to kick in after 16Mb of cache with most drives in normal uses, though.

The Optical drive cache, from what I understand, is also similar.

In short: It's really fast ram type stuff that stores things, and makes you go faster.

Edit: I started typing this a while ago, but then had to AFK. I see a someone beat me to the punch, heh. :) 
Share
December 16, 2010 11:05:58 PM

Wow, GREAT explanation Zerge :)  I had a feeling it was something like this but you really made it more clear. I'm curious how the cache compares to flash memory in SSDs... now that would be interesting...
m
0
l
December 16, 2010 11:06:21 PM

Best answer selected by Reaper2794.
m
0
l
a b à CPUs
December 17, 2010 2:48:52 AM

reaper2794 said:
Wow, GREAT explanation Zerge :)  I had a feeling it was something like this but you really made it more clear. I'm curious how the cache compares to flash memory in SSDs... now that would be interesting...


Heh, thanks :D 

Though both Cache and SSDs use a kind of memory, they're very different.
To make it concise, we're talking about the difference between Static RAM and Flash (EEP)ROM. Flash EEPROM bypasses the volatile nature of typical RAM (Volatile being that it loses all its data when not powered) by 'flashing' the data into the chip with its electrically erasable programmable memory system (Hence the acronym EEP). This unfortunately makes it prone to break down after too many rewrite cycles. Things like Static and SD RAM only hold a temporary charge for their memory. This makes them volatile, but good for an enormous amount of rewrites.

This fundamental difference keeps both types of memory in their respective roles. It makes SSDs bad for storage that gets messed with a lot, so it should normally be reserved for files that tend to remain rather static, like the Operating system and games. Cache data gets constantly changed around, so its better on S/SDRAM. For regular mass storage, a Hard Disk Drive is good as its both non-volatile and good for a lot of rewrites, it is however significantly slower.
m
0
l
December 17, 2010 3:07:01 AM

Someone give this guy an award, a trophy, a cookie, just freakin give him something!

XD Thanks bro, really appreciate it, need more people like you around here

It's really interesting how all these different types of memory have different roles.

Now I'm curious bout two more things.

The difference between GDDR and DDR RAM, and also the difference between L1, L2 cache and so on

The CPU I have has 8 MB of L3 cache, Im guessing thats pretty good
m
0
l
a b à CPUs
December 17, 2010 3:29:40 AM

zergesys said:
Heh, thanks :D 

Though both Cache and SSDs use a kind of memory, they're very different.
To make it concise, we're talking about the difference between Static RAM and Flash (EEP)ROM.


Well, to be a little more precise, not all caches are made of SRAM. CPU caches tend to be SRAM, but hard drive caches are typically DRAM, as it is much cheaper per GB, and only a bit slower. For CPUs, the speed difference is critical, but for hard drives, the cost is the bigger issue.
m
0
l
a b à CPUs
December 17, 2010 3:44:46 AM

Wow, thanks for the praise! I appreciate being appreciated :) 

Anyways...

GDDR and DDR are basically the exact same thing, actually. GDDR's only real unique gimmick is that it supports a feature set called "dual porting", where by the memory can do Read/Write operations with the graphics chipset while the RAMDAC (Digital Anolog Converter) does Read operations from the same memory. This sped up operations quite a bit with analog signals. You don't see it used as much anymore as all the display technology has moved to digital. Otherwise, it's just DDR ram optimized for use with graphics cards, storing things like textures, shaders, buffers, etc. Believe it or not, there were times when the RAM on video cards and the RAM on the system were the exact same.

The levels of cache are a more interesting thing to get into. Fundamentally, you see a hierarchy of cache going from the smallest capacity and number (L1), which is attached directly to the cores, slowly outward to the largest capacity and corresponding numbers (L3), which connect with the system. The L1 cache is sometimes divided into an Instruction and Data set, otherwise its combined into a 'unified' cache. The L1 cache is used as the CPU core's primary cache for operations currently underway.
The L2 and L3 cache use that 'prediction' and 'pre-loading' thing I was talking about in a previous post to get data ready for future use. Specifically, for them, it's a "look side buffer" for the L2 and an "auto data pre-fetch" for the L3. These two are pretty similar, its just the L2's buffer is optimized to connect with the L1 cache.

When the CPU is looking for the data it needs, it will refer to the L cache hierarchy in order, from lowest to highest, until it finds what it needs, up until worst case it has to go to all the way out to the system's RAM. The farther out it has to look, the more latency it will run into, this makes that scaling cache size thing I mentioned (larger the farther out it goes) important.

That large 8Mb L3 cache will mean the pre-fetching should have the data required for the CPU's operations readily available more often than a smaller L3 cache. This gets into stuff simply known as "hitting" and "missing". Larger cache data "hit" rates mean better performance for your CPU.
m
0
l
a b à CPUs
December 17, 2010 3:48:42 AM

cjl said:
Well, to be a little more precise, not all caches are made of SRAM. CPU caches tend to be SRAM, but hard drive caches are typically DRAM, as it is much cheaper per GB, and only a bit slower. For CPUs, the speed difference is critical, but for hard drives, the cost is the bigger issue.


*Faceplam* Forgot about that! Thanks :) 
m
0
l
!