From 1b23336a297681dc12700880540a5a8d31f146fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 9 Jan 2012 11:36:03 +0100 Subject: 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 --- tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/benchmarks/corelib') 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() -- cgit v1.2.3