L2 Vs. L3 CPU cache speed and performance

cpucpu-cacheperformancespeed

In the past few years, looking at Intel CPUs, there has been a move from large size L2 cache to large size L3 cache.
A lot of this is due to having more cores on the CPU and wanting to share the cache between them (an L3 advantage).

But supposing I have a single threaded application and I want to compare the speed I get running it on 2 different CPUS that share the same clock speed :

  1. a CPU with 6MB L2 cache @3.1Ghz (e.g., Core 2 Duo E8500)

  2. a CPU with 6MB L3 cache @3.1Ghz (e.g., Core i5 2400)

Disregarding turbo boost effects and faster DDR factors,
It seems the first (older) CPU should perform much faster (as it is closer to the core level), no ?

Another question that interests me, In old times, back in the first days of L2 cache in CPUs I seem to recall that L2 cache is accessed at half the CPU clock speed, is that still true today ? and what about L3 speed ?

Best Answer

It depends. If the inner loop of your program fits into the L1 cache of both CPUs and memory speeds are the same, you won't see much difference.

If the inner loop fits into the 6MB L2 cache, but does not fit into the L2 cache of the CPU with 6MB L3 cache, then the program will be faster on the older CPU with the larger L2 cache.

But in general, the inner loop part of a program is very small.

Related Question