summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-12-04 09:03:36 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2009-12-04 09:03:36 (GMT)
commit6001ef3bb9cdf41c5375a22cdaee85fffdf3b644 (patch)
treef37a69fc24d84522a0cb388802a38022a3cd9943 /tests/benchmarks
parentd1a28d167295958a4404fab37d60ef530c692590 (diff)
parentd7b34583926e3bd751120a4b827cd5ba6667dea3 (diff)
downloadQt-6001ef3bb9cdf41c5375a22cdaee85fffdf3b644.zip
Qt-6001ef3bb9cdf41c5375a22cdaee85fffdf3b644.tar.gz
Qt-6001ef3bb9cdf41c5375a22cdaee85fffdf3b644.tar.bz2
Merge commit 'oslo-staging-1/4.6' into master-mainline
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qdir/tst_qdir.cpp37
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];