cxx-benchmark-count-digits
cxx-benchmark-count-digits copied to clipboard
Timing measurement method
I am running some code benchmarks on Linux and I have a few comments about the method you used here:
- Setting CPU governor mode to performance will set CPU clock to turbo speed if available. This may be throttled down by CPU thermal management, when die temperature exceeds safe threshold, which will affect time measurements. Wouldn't it be better to set it to CPU rated speed and disabling turbo mode?
- I'm curious why you chose median times instead of minimum ones? Median is good for sanity check, but still contains noise induced by other system activities.
- Yes, you're right. But it seems that with new
intel_pstate
driver there is no way to set governor mode touserspace
. - I actually don't remember, maybe it was just my stupidity :)
I'm a noob on Linux, but I'm using indicator-cpufreq on Xubuntu and it allows to set both the governor and specific CPU frequency. I selected the maximum non-turbo frequency and cpufreq-info confirms that it is indeed set. I hope that I can trust cpufreq-info reports.
Starting with kernel 3.9 there is a new driver for power scaling that is used on Sandy/Ivy cpus, and it supports only performance and powersave governors. And it seems that it doesn't allow to set fixed frequency.
# cpupower frequency-info
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 0.97 ms.
hardware limits: 1.60 GHz - 3.80 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 1.60 GHz and 3.80 GHz.
The governor "powersave" may decide which speed to use
within this range.
current CPU frequency is 2.28 GHz (asserted by call to hardware).
boost state support:
Supported: yes
Active: yes
3600 MHz max turbo 4 active cores
3700 MHz max turbo 3 active cores
3800 MHz max turbo 2 active cores
3800 MHz max turbo 1 active cores
I'm running kernel 3.8 and it seems that indicator-cpufreq app sets fixed CPU frequency just fine.