diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2012-01-09 11:36:03 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-16 02:00:30 +0100 |
commit | 1b23336a297681dc12700880540a5a8d31f146fe (patch) | |
tree | a9b3b0ed63d3d14b1741644a38cd87c0510a89cf /tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp | |
parent | 214e031d56714ba69ef929f1e763e243b393e460 (diff) | |
download | qtbase-1b23336a297681dc12700880540a5a8d31f146fe.tar.gz |
Use static-less QMetaType API in QVariant.
This patch improves performance when constructing a custom type in
a QVariant by ~ 7-20% (instructions count) depending on the type size
and metatype attributes.
Change-Id: Ic2707ff5abd689b66e23c1794f111504bf9b3b01
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp')
-rw-r--r-- | tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp index e842e18d52..f6b4d88311 100644 --- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp @@ -90,6 +90,7 @@ struct BigClass double n,i,e,r,o,b; }; Q_STATIC_ASSERT(sizeof(BigClass) > sizeof(QVariant::Private::Data)); +Q_DECLARE_TYPEINFO(BigClass, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(BigClass); struct SmallClass @@ -97,6 +98,7 @@ struct SmallClass char s; }; Q_STATIC_ASSERT(sizeof(SmallClass) <= sizeof(QVariant::Private::Data)); +Q_DECLARE_TYPEINFO(SmallClass, Q_MOVABLE_TYPE); Q_DECLARE_METATYPE(SmallClass); void tst_qvariant::testBound() |