XMP
Does RAM frequency matter? I have seen many times this question on different forums. Because I have a RAM which might be overclocked I will try answer on this question. By default BIOS has disabled Extreme Memory Profile (XMP) and it means that RAM frequency is 2133 MHz. You can check your current set up in this way:
$ sudo dmidecode --type 17 | grep -E '(Speed|Rank)'
Speed: 2134 MHz
Rank: 2
Configured Clock Speed: 1067 MHz
Speed: 2134 MHz
Rank: 1
Configured Clock Speed: 1067 MHz
Speed: 2134 MHz
Rank: 2
Configured Clock Speed: 1067 MHz
Speed: 2134 MHz
Rank: 1
Configured Clock Speed: 1067 MHz
Because I’m a programmer for me memory is like an array. One of the most common action executed on it is copying data – in this case C/C++ developers use mostly memcpy(). To resolve mystery we need only make measurements of copying data before and after change of RAM frequency. Fortunately we have command line tool mbw (Memory BandWidth benchmark), it should be available on your Linux distribution. Mbw allows us gather results easily:
$ mbw -n 100 -t0 4096
Long uses 8 bytes. Allocating 2*536870912 elements = 8589934592 bytes of memory.
Getting down to business... Doing 100 runs per test.
0 Method: MEMCPY Elapsed: 0.68755 MiB: 4096.00000 Copy: 5957.394 MiB/s
1 Method: MEMCPY Elapsed: 0.69150 MiB: 4096.00000 Copy: 5923.372 MiB/s
2 Method: MEMCPY Elapsed: 0.69368 MiB: 4096.00000 Copy: 5904.782 MiB/s
...
98 Method: MEMCPY Elapsed: 0.69471 MiB: 4096.00000 Copy: 5896.002 MiB/s
99 Method: MEMCPY Elapsed: 0.69302 MiB: 4096.00000 Copy: 5910.406 MiB/s
AVG Method: MEMCPY Elapsed: 0.69311 MiB: 4096.00000 Copy: 5909.561 MiB/s
On default configuration average value of copying data took 5909 MB/s. (BTW, I don’t like unit MiB). Let’s find out how it looks like after change. I enabled in BIOS XMP option and I’ve chosen frequency 2800.
System recognised and confirmed change:
$ sudo dmidecode --type 17 | grep -E '(Speed|Rank)'
Speed: 2800 MHz
Rank: 2
Configured Clock Speed: 1400 MHz
Speed: 2800 MHz
Rank: 1
Configured Clock Speed: 1400 MHz
Speed: 2800 MHz
Rank: 2
Configured Clock Speed: 1400 MHz
Speed: 2800 MHz
Rank: 1
Configured Clock Speed: 1400 MHz
And again I made the same test:
$ mbw -n 100 -t0 4096
Long uses 8 bytes. Allocating 2*536870912 elements = 8589934592 bytes of memory.
Getting down to business... Doing 100 runs per test.
0 Method: MEMCPY Elapsed: 0.60536 MiB: 4096.00000 Copy: 6766.255 MiB/s
1 Method: MEMCPY Elapsed: 0.60810 MiB: 4096.00000 Copy: 6735.701 MiB/s
2 Method: MEMCPY Elapsed: 0.60853 MiB: 4096.00000 Copy: 6730.930 MiB/s
...
98 Method: MEMCPY Elapsed: 0.60794 MiB: 4096.00000 Copy: 6737.540 MiB/s
99 Method: MEMCPY Elapsed: 0.60724 MiB: 4096.00000 Copy: 6745.263 MiB/s
AVG Method: MEMCPY Elapsed: 0.60777 MiB: 4096.00000 Copy: 6739.396 MiB/s
According to data, after change frequency, function memcpy() is able copy ~800MB more in the same time. The time has come to answer on questions. Is it better result? Obvious – yes. Do I feel that desktop work faster? Truly – no. First, machine contains many units: CPU, GPU, RAM, disks and other. They cooperate together. If any of them is bottleneck then boosting the weakest link always have sense. Does RAM might be bottleneck? Answer is – as always – it depends. If you don’t have a lot memory and your desktop is swapping memory, overclocking RAM doesn’t help. Even if you have the fastest RAM but you read data from slow disk then memory is filled slowly. You can see gain of change only when you work with huge amount of data, stored in memory, otherwise it’s only a feature which nice to have.