diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-11-27 09:55:56 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-11-27 09:56:19 (GMT) |
commit | ef17dac74688a8754aa4434a24ddb19d2ab4dcc5 (patch) | |
tree | 4d2a0a65e091873581fbc7b1894151373d0d4bb9 /tests | |
parent | c8de2b42348eb8665bee3948895c397c4a364251 (diff) | |
download | Qt-ef17dac74688a8754aa4434a24ddb19d2ab4dcc5.zip Qt-ef17dac74688a8754aa4434a24ddb19d2ab4dcc5.tar.gz Qt-ef17dac74688a8754aa4434a24ddb19d2ab4dcc5.tar.bz2 |
Improve QFileInfo benchmark
Reviewed-by: TrustMe
Diffstat (limited to 'tests')
-rw-r--r-- | tests/benchmarks/qfileinfo/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/benchmarks/qfileinfo/main.cpp b/tests/benchmarks/qfileinfo/main.cpp index 7950f58..711209c 100644 --- a/tests/benchmarks/qfileinfo/main.cpp +++ b/tests/benchmarks/qfileinfo/main.cpp @@ -44,6 +44,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QFileInfo> +#include "private/qfsfileengine_p.h" class qfileinfo : public QObject { @@ -67,11 +68,12 @@ void qfileinfo::cleanupTestCase() void qfileinfo::canonicalFileNamePerformance() { + QString appPath = QCoreApplication::applicationFilePath(); + QFSFileEnginePrivate::canonicalized(appPath); // warmup + QFSFileEnginePrivate::canonicalized(appPath); // more warmup QBENCHMARK { for (int i = 0; i < 5000; i++) { - // this actually calls canonicalFilePath twice, once inside QCoreApplication. - QFileInfo fi(QCoreApplication::applicationFilePath()); - fi.canonicalFilePath(); + QFSFileEnginePrivate::canonicalized(appPath); } } } |