qt5base-lts/tests/benchmarks/corelib/kernel/kernel.pro
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

14 lines
252 B
Prolog

TEMPLATE = subdirs
SUBDIRS = \
events \
qmetaobject \
qmetatype \
qobject \
qvariant \
qcoreapplication \
qtimer_vs_qmetaobject
!qtHaveModule(widgets): SUBDIRS -= \
qmetaobject \
qobject