diff options
Diffstat (limited to 'tests/benchmarks/qfileinfo/main.cpp')
-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); } } } |