L1 cache speed seems slow.

sshele

Reputable
Apr 8, 2015
3
0
4,510
I tested the L1 cache speed of my i5-2450M, by writing a small program that reads a small section of the memory over and over again (less than 2KB section). The result was 25 GB/s (single thread). I also tested with pmbw benchmark, which confirmed the results (25 GB/s for a single thread and 50 GB/s for multiple threads because I have two cores, if the block size is <32KB, my L1 cache size).

One of my friends told me that seems very slow. I couldn't find much benchmarks except this:

http://www.sisoftware.eu/rank2011d/show_run.php?q=c2ffcdfcdabbdae7d5e1d6efd7f183be8ea8cda895a583f0cdfd&l=en

which gives more like 200 GB/s. Could someone confirm whether 25 GB/s is indeed very slow for a mobile Sandy Bridge i5? And if it is indeed slow, maybe someone has any ideas why or how could I fix it? I checked that I have the latest bios version. I have a Dell N5110 laptop.
 
It's more then likely a software issue, rather then an issue with the cache. You REALLY have to put thought into how to properly write a program so you are measuring cache, rather then memory, performance.
 
I tried changing my power settings in Windows 7, which I changed from Balanced to High Performance. Then I did a restart and benchmarked using my own loop, I got 100 GB/s read and 50 GB/s write. So I figured that was it and ran the other pmbw tool to confirm the results. Here is the graph the benchmark tool outputs (first page shows data rates):

http://www.docdroid.net/wutw/plots-andres-pc-high-perf.pdf.html

It did the write test before (lasts a couple of minutes), then the read tests. As you can see, the write speed was near 45 GB/s, but the read speed was only 24 GB/s. After that I ran my own program and got roughly 25/12 GB/s read/write, and after that the pmbw agreed with it. So for a short time, my L1 cache speed seemed OK, but for the most time it seems to be 4 times slower than expected.

I have similarly noticed that sometimes a memory intensive program runs several times faster than usual, for a few runs in a row and then goes back to usual.

Here is a usual graph of my cache speed, as tested by pmbw benchmark:

http://www.docdroid.net/wuyx/plots-andres-pc.pdf.html

I also ran the SiSoftware Sandra free version Cache Bandwidth test, which oddly gives the same results for multi-thread and single-thread tests, so it probably always uses several threads. This should be similar to the test in the link in the first post and to the test on this site. In the L1 region for me it gives around 40 GB/s (probably multithreaded):

http://www.docdroid.net/wuwp/cache.pdf.html

Ideas what else to try are welcome, maybe some other cache benchmarks or diagnostic tools? I ran the Intel Processor Diagnostic Tool which did some general tests and didn't find problems.
 
Do you have any idea how many variables there could be? How many processes and threads are active at the time you run these tests, for starters? Any, and I mean any activity whatsoever from any other process can throw you off. Processor switches can throw you off. Do you know, for instance, how to lock your thread non-pre-emptably to a particular processor? How many task switches are you getting during your test? How many L1 cache misses? What statistics are you collecting?

I respectfully suggest that you take this to the Intel Community forums. A link to one discussion is in a prior post on this thread. I'd love to follow and see what results you eventually get, since I'm fascinated by these "bare metal" type tests.