[Development] Let's get rid of qDebug/qWarning/qCritical!

Thiago Macieira thiago.macieira at intel.com
Fri Jan 10 17:41:47 CET 2014


On sexta-feira, 10 de janeiro de 2014 12:04:23, Koehne Kai wrote:
> And here are the results:        
> 
> PASS   : CatLogBench::qWarningPrintf1()
> RESULT : CatLogBench::qWarningPrintf1():
>      0.0010 msecs per iteration (total: 67, iterations: 65536)
> PASS   : CatLogBench::qWarningPrintf2()
> RESULT : CatLogBench::qWarningPrintf2():
>      0.0013 msecs per iteration (total: 90, iterations: 65536)
> PASS   : CatLogBench::qWarningStream()
> RESULT : CatLogBench::qWarningStream():
>      0.0016 msecs per iteration (total: 54, iterations: 32768)
> PASS   : CatLogBench::qCWarningStream()
> RESULT : CatLogBench::qCWarningStream():
>      0.0018 msecs per iteration (total: 59, iterations: 32768)
> PASS   : CatLogBench::qCWarningPrintf()
> RESULT : CatLogBench::qCWarningPrintf():
>      0.0010 msecs per iteration (total: 69, iterations: 65536)
> PASS   : CatLogBench::cleanupTestCase()
> Totals: 7 passed, 0 failed, 0 skipped
> 
> So, there is of course some measurable overhead, but I wouldn't say it
> disqualifies the streaming variant per se

For more statistically-valid benchmark results:

1) make sure the total run time is at least half a second per test function 
(those ran for 50 ms)

2) make sure the CPU is locked to performance mode and Turbo is disabled:
 # tee <<<performance /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
 # cut -f2 -d' ' 
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies | \
	tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
 (doesn't work on Linux 3.12 with the new intel_idle driver)

3) you may want to run with the perf counter on Linux to get actual CPU 
cycles. Pass -minimumtotal to a suitable value to get a runtime of half a 
second.

4) Run it 6 to 10 times and average out. Use the -csv logger mode so you can 
easily import into a spreadsheet. https://codereview.qt-project.org/74321

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140110/ca86975b/attachment.sig>


More information about the Development mailing list