From a5a859e721e7a1d0c5a3ec6abe2db55d9144bb36 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 Jan 2019 16:02:09 +0100 Subject: 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) Reviewed-by: hjk --- tests/auto/other/toolsupport/tst_toolsupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/other/toolsupport') 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 -- cgit v1.2.3 From 5cc6f90910082f35e3f5340493facbc8c175f65f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 7 Jan 2019 15:05:06 +0100 Subject: Move all connection related data into one data structure Adn create that data structure on demand on the heap. This reduces the size of QObjectPrivate if there are no connections. If we have connections, it'll use the same amount of allocations and memory as before. Change-Id: I900f6980a2cd8a5f72c3ad18697b5dd49100217d Reviewed-by: Olivier Goffart (Woboq GmbH) --- tests/auto/other/toolsupport/tst_toolsupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/other/toolsupport') diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index 27bc6ba646..8c129adaf3 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 << 160 << 240; + data << 152 << 224; #else - data << 164 << 240; + data << 156 << 224; #endif } #endif -- cgit v1.2.3