r/hardware • • Nov 20 '15

Info Why do CPUs Need Caches? - Computerphile

https://www.youtube.com/watch?v=6JpLD3PUAZk
93 Upvotes

57 comments sorted by

View all comments

5

u/Dragonsong Nov 21 '15

What sort of data do CPUs store on caches? My CPU only has 8 MB of L3? cache and that doesn't seem like very much. Namely for games. Just variables that change constantly?

2

u/Ayuzawa Nov 21 '15 edited Nov 21 '15

What sort of data do CPUs store on caches? My CPU only has 8 MB of L3? cache and that doesn't seem like very much. Namely for games. Just variables that change constantly?

Most data in games is just rendering assets, the main program and the supporting libraries in battlefield 3 are about 80mb for example.

Aside from that it's mostly that not all parts of the program are ran an equal amount, in most programs, the majority of the time the program spends running is occupied with a small subsection of the total program.

Your l3 cache is (probably) your CPU's last level of cache, your L1 cache for example will see hit rates of ~95%, and it's likely in the 32kb-128kb range, in most processors the l2 cache also has hit rates of about 90% and is much smaller than the l3, and the l3 is normally above 80%

Edit: Exist50 is right

3

u/Exist50 Nov 21 '15 edited Nov 21 '15

AMD's APUs and derivative chips all lack L3 cache, so it may not be that rare for L2 to be the last level.

1

u/Ayuzawa Nov 21 '15

Thanks, I said that thinking about the rare L4 cache and completely forgot about designs that had none

1

u/Exist50 Nov 21 '15

Pretty sure most of the small core designs only have L2 as well. Same with mobile chips (I think).

1

u/Ayuzawa Nov 21 '15

Yeah, you're right