cxx-benchmark-count-digits icon indicating copy to clipboard operation
cxx-benchmark-count-digits copied to clipboard

Timing measurement method

Open pauljurczak opened this issue 10 years ago • 4 comments

I am running some code benchmarks on Linux and I have a few comments about the method you used here:

  1. 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?
  2. 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.

pauljurczak avatar Sep 14 '13 20:09 pauljurczak

  1. Yes, you're right. But it seems that with new intel_pstate driver there is no way to set governor mode to userspace.
  2. I actually don't remember, maybe it was just my stupidity :)

localvoid avatar Sep 15 '13 02:09 localvoid

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.

pauljurczak avatar Sep 15 '13 07:09 pauljurczak

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

localvoid avatar Sep 15 '13 08:09 localvoid

I'm running kernel 3.8 and it seems that indicator-cpufreq app sets fixed CPU frequency just fine.

pauljurczak avatar Sep 15 '13 10:09 pauljurczak