qt5base-lts/tests/benchmarks/corelib
Milian Wolff 4413f7070a Enable and extend the qtimer_vs_qmetaobject benchmark
This benchmark was not compiled, and it only covered some parts of the
API. Enable it, and also measure the performance of PMF and Functor API
variants, for both QTimer::singleShot and QMetaObject::invokeMethod.

This uncovers that the zero-timeout optimization for the singleShot is
not applied to the PMF and Functor API variants:

********* Start testing of qtimer_vs_qmetaobject *********
Config: Using QtTest library 5.11.0, Qt 5.11.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.2.1 20171224)
PASS   : qtimer_vs_qmetaobject::initTestCase()
PASS   : qtimer_vs_qmetaobject::bench(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot":
     5.20 msecs per iteration (total: 520, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf":
     75.93 msecs per iteration (total: 7,594, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor":
     77.90 msecs per iteration (total: 7,790, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx":
     76.23 msecs per iteration (total: 7,624, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string":
     4.99 msecs per iteration (total: 499, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf":
     5.37 msecs per iteration (total: 538, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor":
     4.74 msecs per iteration (total: 474, iterations: 100)
PASS   : qtimer_vs_qmetaobject::cleanupTestCase()
Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted, 50220ms
********* Finished testing of qtimer_vs_qmetaobject *********

Change-Id: I46336613188317124804638627f07eb135dc0286
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-03-27 06:37:33 +00:00
..
codecs Updated license headers 2016-01-21 18:55:18 +00:00
io Merge remote-tracking branch 'origin/5.12' into 5.13 2019-02-19 01:00:08 +01:00
json Updated license headers 2016-01-21 18:55:18 +00:00
kernel Enable and extend the qtimer_vs_qmetaobject benchmark 2019-03-27 06:37:33 +00:00
mimetypes Use a std::vector instead of a QVector in QMimeDatabasePrivate 2018-09-29 14:22:18 +00:00
plugin tst_bench_QUuid: eliminate an unused variable 2018-06-14 09:15:06 +00:00
thread Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
tools Merge remote-tracking branch 'origin/5.12' into 5.13 2019-02-19 01:00:08 +01:00
corelib.pro