diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-11-24 11:08:13 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-11-30 23:02:27 +0000 |
commit | de4a73ebd6ab686f18a3b5f450eb3dbd8a440970 (patch) | |
tree | dde402152dc6836e493a9657f99ca965472c3762 /tests/auto/other | |
parent | 92d60ae589442cfbe1e7ac1bb4c42334a09af310 (diff) |
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 <fabian.kosmale@qt.io>
(cherry picked from commit 98c82fb445acf45cc4c4bc86a5adda43358127bf)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/other')
-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 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) } { |