summaryrefslogtreecommitdiffstats
path: root/src/testlib/qbenchmark_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-08-17 20:44:39 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-06-21 11:46:59 +0000
commite4750177536d096221a50d221124a4f1047a5456 (patch)
tree4261af41a72025954c709567c11511bb8c42e21c /src/testlib/qbenchmark_p.h
parent3045ac99f296b866b25df318f13726d8f64494e8 (diff)
QtTest: don't hold QBenchmarkResults in QList
QBenchmarkResult is larger than a void*, so holding them in a QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Also saves ~1.2KiB of text size on GCC 4.9 optimized C++11 AMD64 Linux builds. Change-Id: I0c99e591bb9b4405aa1bb78ec095dcaf9277993f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/testlib/qbenchmark_p.h')
-rw-r--r--src/testlib/qbenchmark_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index d785f3d4b7..6312a34cb8 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -91,6 +91,7 @@ struct QBenchmarkContext
QBenchmarkContext() : checkpointIndex(-1) {}
};
+Q_DECLARE_TYPEINFO(QBenchmarkContext, Q_MOVABLE_TYPE);
class QBenchmarkResult
{
@@ -126,6 +127,7 @@ public:
return (value / iterations) < (other.value / other.iterations);
}
};
+Q_DECLARE_TYPEINFO(QBenchmarkResult, Q_MOVABLE_TYPE);
/*
The QBenchmarkGlobalData class stores global benchmark-related data.