Skip to content
/ qtbase Public

Commit 12c5a48

Browse files
committed
QMap: also benchmark O(10) elements in take()
Allan asked for this, as that seems to be a typical size for QMap in Qt apps (which makes me wonder why we keep using a container that is so terribly inefficient for that number of entries). Amends fd7b340. Pick-to: 6.10 6.8 6.5 Change-Id: I931f223c3c1aae16e43059e9cfa65ba679632c01 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit f6eaf6d) Reviewed-by: Marc Mutz <marc.mutz@qt.io>
1 parent ce1bf03 commit 12c5a48

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/benchmarks/corelib/tools/qmap/tst_bench_qmap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ void tst_QMap::take_data()
312312
QTest::addRow("1 in {0}") << 1 << 1;
313313
QTest::addRow("0 in {0, 1}") << 2 << 0;
314314
QTest::addRow("1 in {0, 1}") << 2 << 1;
315+
QTest::addRow("0 in {0...16}") << 17 << 0;
316+
QTest::addRow("7 in {0...16}") << 17 << 7;
317+
QTest::addRow("16 in {0...16}") << 17 << 16;
315318
QTest::addRow("1024 in {0...2047}") << 2048 << 1024;
316319
}
317320

0 commit comments

Comments
 (0)