L1 vs L2 vs L3 cache, please help

lau808

Senior member
Jun 25, 2011
217
0
71
anyone got a good explaination or link? also and more importantly... L3 cache vs none would benefit how? avg joe browsing web and flash games/videos benefit at all?
 

nonameo

Diamond Member
Mar 13, 2006
5,902
2
76
Your current system is fine for the average joe. If you want to spend some money, consider getting an SSD. You will be much happier with that than a new CPU.

edit: XD I see you already have an ssd planned... :D

L3 will not make any appreciable difference in those things. a 4130 is fine, but right now the 955 BE is a pretty good deal. Also, you could consider a sandy bridge CPU and motherboard, but the 955 should drop into what you already have with no problem. Also, I'd settle for some generic DDR3-1333 instead unless you plan to overclock(and the HP system probably isn't equipped well for OC'ing tbh...). You'll save a few bucks.
 
Last edited:

sao123

Lifer
May 27, 2002
12,656
207
106
In lay terms...

your cpu access is very fast, compared to main memory (ram), which is exceedingly slower.

Since most programming often involves loops and code reuse (aka functions etc), in order to speed things up a bit, instructions from RAM are copied into a smaller memory called the cache.

the reason for the different levels of cache are the following...

level 1 is very fast... almost as fast as the cpu itself. but it is very expensive.
if your ram was made out of the memory lvl 1 cache was, it would be 10x as expensive, and cost prohibitive. because it is so expensive, your cpu only have a few hundred kilobytes of it.

lvl 2 cache... somewhat slower, but cheaper

lvl 3 cache... even slower, and cheaper memory, same principal, but still faster than main memory (RAM)

So, when a cpu attempts to load an the next instruction from memory, it copies it into all 3 caches. when you get into a loop, the next time it goes to the top, it can fetch part or all of the loop from the faster memory (the cache), thus improving performance.
since lvl 1 is so small, it gets overwritten a lot, level 2 is larger and will get overwritten less, and lvl 3 is even larger and will get overwritten less than 2.
any cache hit is still faster than RAM access. If the next instruction is not in RAM, then it is slow.

If you understand the concept of the SWAP FILE (virtual RAM) its the same concept, except the reverse... instead of larger and slower, its faster and smaller.
in short... more cache = better performance for any program.
 
Last edited:

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,806
4,787
75
Imagine you are the CPU, and food represents data in RAM. Your hands are your L1 cache, for that bag of chips or that sandwich. Your kitchen is your L2 cache - very nearby, but you have to take the time to get up to get food there. You might have an L3 cache like a root cellar or basement. Main memory is the grocery store - it takes awhile to drive there and back, and you want to pick up large quantities to store in your L2/L3 caches when you go there.

My mom got an HP recently for herself, and I was surprised when I looked inside that it had only one 4GB stick of DDR3. In our food analogy, this is like having a grocery store with the shelves not placed back-to-back. That means each aisle only has shelves on one side, so it takes more trips down aisles to get the food you're looking for. If you have the same configuration, adding a matching stick of DDR3 (same size, voltage, and speed) could improve your performance alot.
 

lau808

Senior member
Jun 25, 2011
217
0
71
ok, i think i got it. thank u, i am building my next rig around the fx4130 or w/e its gonna be called but wanted to understand cache as i had no clue. but was mainly asking as i will be building a few pc's for family members and couldnt decide between phenom II x2 or an athlon II x2.
 

lau808

Senior member
Jun 25, 2011
217
0
71
mother in law says she wants to use photoshop... how many threads does it use?
 

dma0991

Platinum Member
Mar 17, 2011
2,723
2
0
mother in law says she wants to use photoshop... how many threads does it use?
I don't think it matters assuming that your MIL is just a casual user who does not deal with hundreds of layers at once. Just about any dual core could do Photoshop easily for the casual user.