diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-01-26 10:11:20 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-01-27 10:30:26 +0100 |
commit | bf7b1a2aa83ce631879914cb98133e32b20f0104 (patch) | |
tree | 3c9a1f07070da16af8df5bd8f03a3fe3633d2475 /src/corelib/global/qglobalstatic.h | |
parent | 00b759a8d06dbec42232b1b8748c0725da7ced00 (diff) |
QVariant: Do not destroy trivial types
perf indicates that we spend quite some time in ~QVariant in the
referenced task's benchmark. With this patch, we significantly reduce
the amount of work we do in the destructor for trivial types: Instead of
calling an out-of-line function, which does a few checks and then does
an indirect call through a function pointer to a do-nothing dtor before
freeing the memory, we now simply free the memory.
We achieve this by changing QMetaTypeInterface to leave the dtor
function pointer null if the type is trivially destructible. Then, in
QVariant we use the QMetaTypeInterface directly instead of going through
QMetaType.
Task-number: QTBUG-90560
Change-Id: Iaf87036710e1680323842e1ba703a5d3d0e5027a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/global/qglobalstatic.h')
0 files changed, 0 insertions, 0 deletions