summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2020-10-22 11:39:34 +0200
committerAndreas Buhr <andreas.buhr@qt.io>2020-10-23 06:55:35 +0200
commit2516fc935cfa77bd42e9cededf7e8be8c0980e13 (patch)
tree9735408ed42f1472b02e66e1274bd1567d7cd51b /tests/benchmarks/corelib
parentcca62a7360a117880eea5821fd7403d68a1431c8 (diff)
Add benchmark for QString::number(int)
Add a almost trivial benchmark for QString::number(int). Change-Id: Ice67eaf28e8d7b235fd5ec5e0b87b3b9053ae61e Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/benchmarks/corelib')
-rw-r--r--tests/benchmarks/corelib/text/qlocale/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/benchmarks/corelib/text/qlocale/main.cpp b/tests/benchmarks/corelib/text/qlocale/main.cpp
index 7047338800..7f6eeae993 100644
--- a/tests/benchmarks/corelib/text/qlocale/main.cpp
+++ b/tests/benchmarks/corelib/text/qlocale/main.cpp
@@ -37,6 +37,7 @@ private Q_SLOTS:
void toUpper_QLocale_1();
void toUpper_QLocale_2();
void toUpper_QString();
+ void number_QString();
};
static QString data()
@@ -66,6 +67,14 @@ void tst_QLocale::toUpper_QString()
QBENCHMARK { LOOP(QString t(s.toUpper())) }
}
+void tst_QLocale::number_QString()
+{
+ QString s;
+ QBENCHMARK {
+ s = QString::number(12345678);
+ }
+}
+
QTEST_MAIN(tst_QLocale)
#include "main.moc"