diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-12-05 11:20:23 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-12-05 11:20:33 (GMT) |
commit | 291a26abae4b7e1e4b77baf42964ccb77edf4adf (patch) | |
tree | c7dfb42a84295438ef163e4975f6af2d88f649cc /tests/benchmarks | |
parent | 1bb5999cdca0a70df3f96d596c83c3cf7c97c5fd (diff) | |
parent | 33441e2a611f07207b0b942368aab9010cdf8ab1 (diff) | |
download | Qt-291a26abae4b7e1e4b77baf42964ccb77edf4adf.zip Qt-291a26abae4b7e1e4b77baf42964ccb77edf4adf.tar.gz Qt-291a26abae4b7e1e4b77baf42964ccb77edf4adf.tar.bz2 |
Merge commit '33441e2a611f07207b0b942368aab9010cdf8ab1' of oslo-staging-1/4.6 into 4.6
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/qdir/tst_qdir.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/tests/benchmarks/qdir/tst_qdir.cpp b/tests/benchmarks/qdir/tst_qdir.cpp index fd558d3..64c6ba1 100644 --- a/tests/benchmarks/qdir/tst_qdir.cpp +++ b/tests/benchmarks/qdir/tst_qdir.cpp @@ -78,6 +78,8 @@ public slots: temp.rmdir(QLatin1String("test_speed")); } private slots: + void baseline() {} + void sizeSpeed() { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QBENCHMARK { @@ -88,6 +90,18 @@ private slots: } } } + void sizeSpeedIterator() { + QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); + QBENCHMARK { + QDirIterator dit(testdir.path(), QDir::Files); + while (dit.hasNext()) { + dit.fileInfo().isDir(); + dit.fileInfo().size(); + dit.next(); + } + } + } + void sizeSpeedWithoutFilter() { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); QBENCHMARK { @@ -97,6 +111,18 @@ private slots: } } } + void sizeSpeedWithoutFilterIterator() { + QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); + QBENCHMARK { + QDirIterator dit(testdir.path()); + while (dit.hasNext()) { + dit.fileInfo().isDir(); + dit.fileInfo().size(); + dit.next(); + } + } + } + void sizeSpeedWithoutFileInfoList() { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); testdir.setSorting(QDir::Unsorted); @@ -108,6 +134,7 @@ private slots: } } } + void iDontWantAnyStat() { QDir testdir(QDir::tempPath() + QLatin1String("/test_speed")); testdir.setSorting(QDir::Unsorted); @@ -119,8 +146,16 @@ private slots: } } } + void iDontWantAnyStatIterator() { + QBENCHMARK { + QDirIterator dit(QDir::tempPath() + QLatin1String("/test_speed")); + while (dit.hasNext()) { + dit.next(); + } + } + } - void testLowLevel() { + void sizeSpeedWithoutFilterLowLevel() { #ifdef Q_OS_WIN const wchar_t *dirpath = (wchar_t*)testdir.absolutePath().utf16(); wchar_t appendedPath[MAX_PATH]; |