qt6-bb10/tests/benchmarks/corelib
Robin Burchell 2af04860f6 qtimezoneprivate_tz: Apply a cache over the top of timezone data
Constantly re-reading the timezone information only to be told the exact
same thing is wildly expensive, which can hurt in operations that cause
a lot of QTimeZone creation, for example, V4's DateObject - which
creates them a lot (in DaylightSavingTA).

This performance problem was identified when I noticed that a
QDateTime binding updated once per frame was causing >100% CPU usage
(on a desktop!) thanks to a QtQuickControls 1 Calendar (which has a
number of bindings to the date's properties like getMonth() and so
on).

The newly added tst_QTimeZone::systemTimeZone benchmark gets a ~90%
decrease in instruction count:

--- before
+++ after
 PASS   : tst_QTimeZone::systemTimeZone()
 RESULT : tst_QTimeZone::systemTimeZone():
-     0.024 msecs per iteration (total: 51, iterations: 2048)
+     0.0036 msecs per iteration (total: 59, iterations: 16384)

Also impacted (over in QDateTime) is
tst_QDateTime::setMSecsSinceEpochTz(). The results here are - on the
surface - less impressive (~0.17% drop), however, it isn't even
creating QTimeZone on a hot path to begin with, so a large drop would
have been a surprise.

Added several further benchmarks to cover non-system zones and
traverse transitions.

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-75585
Change-Id: I044a84fc2d3a2dc965f63cd3a3299fc509750bf7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-20 16:58:09 +02:00
..
codecs Updated license headers 2016-01-21 18:55:18 +00:00
io Win: qdiriterator bench: fix missing null-terminator issues 2019-07-10 07:18:05 +00:00
json Updated license headers 2016-01-21 18:55:18 +00:00
kernel Optimize QTimer::singleShot(0, ...) when taking PMF or Functor callable 2019-04-06 21:16:56 +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
text Re-apply 'Skip old benchmark that doesn't build automatically' 2019-07-24 07:45:59 +03:00
thread Don't wrap feature detection macros with QT_HAS_FOO() variants 2019-12-10 00:48:07 +01:00
time qtimezoneprivate_tz: Apply a cache over the top of timezone data 2020-03-20 16:58:09 +02:00
tools Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00
corelib.pro Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00