From de4a73ebd6ab686f18a3b5f450eb3dbd8a440970 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Nov 2020 11:08:13 +0100 Subject: Inline access to the QBindingStorage And inline the fast checks inside the methods in QBindingStorage. This allows QObjectBindableProperty and friends to inline all the fast checks and almost completely eliminates the overhead for property accesses when no bindings are being used. Read and write times of QObject based properties when no bindings are being used: Read Write Old style property: 3.8ns 7.3ns QObjectBindableProperty (no notification): 4.5ns 4.3ns QObjectBindableProperty (with signal): 4.5ns 7.6ns QObjectBindableProperty (inline accessors): 3.2ns 3.4ns Numbers without this patch: Old style property: 3.8ns 7.9ns QObjectBindableProperty (no notification): 7.2ns 7.7ns QObjectBindableProperty (with signal): 7.2ns 16.0ns QObjectBindableProperty (inline accessors): 6.3ns 6.7ns Change-Id: Ifd1fa3a489c3be8b1468c0b88af547aac397f412 Reviewed-by: Fabian Kosmale (cherry picked from commit 98c82fb445acf45cc4c4bc86a5adda43358127bf) Reviewed-by: Ulf Hermann --- tests/auto/other/toolsupport/tst_toolsupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/other') diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index 7acf1ad08d..bd6cc8b293 100644 --- a/tests/auto/other/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp @@ -97,14 +97,14 @@ void tst_toolsupport::offsets_data() { QTestData &data = QTest::newRow("sizeof(QObjectData)") << sizeof(QObjectData); - data << 36 << 64; // vptr + 2 ptr + (2*ptr + int) + 2 int + ptr + data << 44 << 80; // vptr + 2 ptr + (2*ptr + int) + 2 int + ptr } #if RUN_MEMBER_OFFSET_TEST { QTestData &data = QTest::newRow("QObjectPrivate::extraData") << pmm_to_offsetof(&QObjectPrivate::extraData); - data << 36 << 64; // sizeof(QObjectData) + data << 44 << 80; // sizeof(QObjectData) } { -- cgit v1.2.3