Central Processing Unit Cache

Zombie615

Honorable
Feb 9, 2014
487
0
10,810
So I've done some research on CPU cache an how it works. All I've really come up with so far is that L1 is the fastest, L2 a little slower, L3 the slowest. Though with that being said even the slowest L3 cache is much faster than any ram you can install since it doesn't have to travel full circle over the bus to an from the random access memory components. *Correct me if I'm wrong*

Now for the question....

1) If L3 cache is the slowest than how come people have been saying it's a benefit to have L3 cache when playing AAA titles?

2) What type of information does a video game actually store in the cache?

3) How does a game decide which cache to use?
 
Solution
Caches are complicated to explain.

You should know that the CPU never directly talks tot the ram. Its always the cache that talks to the ram. When the CPU needs some data, first it checks L1, if its not there, it checks L2(which is slightly bigger but slower) and if its not there it checks L3 (biggest and slowest). If it still doesn't find it, cache goes to memory, retrieves the data and gives it to the CPU.

Now the benefit of a larger L3 cache is that there is a higher chance the data the cpu is looking for will be there, so it eliminates the need for a "slow" read from memory.

The game doesn't decide what is stored in cache. That is handled by the CPU architecture. Newer cpus have better algorithms for deciding what should be in...
1. it's a benefit to any software since it's much faster than RAM

2. for any program, instructions or data the CPU expects to require soon is often stored there. The CPU has built-in logic to determine what data or instructions are likely to be needed soon and uses the caches to get things ahead of RAM. When data is not found in the cache it has to go all the way out to system RAM (which results in a longer delay)

3. it's all managed by the CPU logic referenced above
 

oczdude8

Distinguished
Caches are complicated to explain.

You should know that the CPU never directly talks tot the ram. Its always the cache that talks to the ram. When the CPU needs some data, first it checks L1, if its not there, it checks L2(which is slightly bigger but slower) and if its not there it checks L3 (biggest and slowest). If it still doesn't find it, cache goes to memory, retrieves the data and gives it to the CPU.

Now the benefit of a larger L3 cache is that there is a higher chance the data the cpu is looking for will be there, so it eliminates the need for a "slow" read from memory.

The game doesn't decide what is stored in cache. That is handled by the CPU architecture. Newer cpus have better algorithms for deciding what should be in the cache to speed up processing. I guess since newer cpus also have more L3 cache, this means they are just generally faster, and better for gaming.
 
Solution

Zombie615

Honorable
Feb 9, 2014
487
0
10,810
Okay so if someone has a CPU with 2x4 MB of L3 Cache than what is the difference between that an one with just 1x8MB of L3 Cache? Does it work the same as dual-channel Ram?

8MB = 8388608 Bytes

Also, I will be trying to do some research on Architecture an the ways it affects the performance. Do you know of any good threads on this site that talk about that type of stuff?
 

oczdude8

Distinguished
That depends on the specific implementation. Often, there are separate caches for cpu instructions and actual data.

Architecture is hard to understand, unless you have a background in computer science/engineering. Try googling cpu design and cpu caches and see what you can learn.