diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-01-03 16:02:09 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-02-08 21:55:10 +0000 |
commit | a5a859e721e7a1d0c5a3ec6abe2db55d9144bb36 (patch) | |
tree | 76d2daecce20da784ee12b56d71175e83cf49d18 /tests | |
parent | 88a2a746b7ed49f4ac4861bbf8e3a55db691fa43 (diff) |
Get rid of the connectedSignals bitflags
Measurements show that it's just almost as fast to simply query
the connectionlist directly and avoid both the memory
overhead of the bitfield and the associated bookkeeping.
For connected signals, the difference is not relevant at all.
With a signal that was never connected, removing the bitfield will
cause signal emission to be ~2.5% faster. And if you ever disconnect
from a signal, the bitfields might not be accurate and this can
cause a major slowdown.
Here are some numbers to validate this. All times are measured
in ms for 100M signal emissions:
without change with change
string based connect: 3817 3836
pointer based connect: 4552 4571
not connected: 493 479
disconnected: 2113 559
Change-Id: Ia2c85036afaa7f991b883c8ff812f69cf4580f7e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/other/toolsupport/tst_toolsupport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index f31a755f9e..27bc6ba646 100644 --- a/tests/auto/other/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp @@ -126,9 +126,9 @@ void tst_toolsupport::offsets_data() #ifdef Q_PROCESSOR_X86 // x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in // qglobal.h for more details. - data << 168 << 248; + data << 160 << 240; #else - data << 172 << 248; + data << 164 << 240; #endif } #endif |