benchlargesync: Do several syncs
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 25 Sep 2017 10:48:33 +0000 (12:48 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Thu, 5 Oct 2017 20:01:36 +0000 (22:01 +0200)
Make sure there is already a small sync before so the database is queried.
Make also a sync after to run an update with many files in the database.

test/benchmarks/benchlargesync.cpp

index 88a774b9096465fa05b9d59a30e96aec6ce4bd05..9e78b9d5c6a51634763e64265595a4787298f892 100644 (file)
@@ -34,10 +34,16 @@ void addBunchOfFiles(int depth, const QString &path, FileModifier &fi) {
 int main(int argc, char *argv[])
 {
     QCoreApplication app(argc, argv);
-    FakeFolder fakeFolder{FileInfo{}};
+    FakeFolder fakeFolder{FileInfo::A12_B12_C12_S12()};
     addBunchOfFiles<10, 8, 4>(0, "", fakeFolder.localModifier());
 
     qDebug() << "NUMFILES" << numFiles;
     qDebug() << "NUMDIRS" << numDirs;
-    return fakeFolder.syncOnce() ? 0 : -1;
+    QElapsedTimer timer;
+    timer.start();
+    bool result1 = fakeFolder.syncOnce();
+    qDebug() << "FIRST SYNC: " << result1 << timer.restart();
+    bool result2 = fakeFolder.syncOnce();
+    qDebug() << "SECOND SYNC: " << result2 << timer.restart();
+    return (result1 && result2) ? 0 : -1;
 }