summaryrefslogtreecommitdiffstats
path: root/tests/storagetest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-08-23 18:56:43 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-08-23 18:56:43 +0200
commit1acf9f3c486813df807ff6931e56cc13eb26eeaf (patch)
tree559ead2e95986515b4a5f93b6f143b8f1d429bd3 /tests/storagetest.cpp
parent62e7084dcd6f53275fcb21ba17e880e41b40094d (diff)
downloadsink-1acf9f3c486813df807ff6931e56cc13eb26eeaf.tar.gz
sink-1acf9f3c486813df807ff6931e56cc13eb26eeaf.zip
Store indexes as named databases in the same db.
Because we also keep using the same transactions this finally makes the resource somewhat performant. On my system genericresourcebenchmark now processes ~4200 messages per second instead of ~280.
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r--tests/storagetest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp
index e872c44..6ba4bcd 100644
--- a/tests/storagetest.cpp
+++ b/tests/storagetest.cpp
@@ -223,7 +223,7 @@ private Q_SLOTS:
223 bool gotError = false; 223 bool gotError = false;
224 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, false); 224 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, false);
225 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 225 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
226 auto db = transaction.openDatabase(); 226 auto db = transaction.openDatabase("default", nullptr, false);
227 db.write("key","value"); 227 db.write("key","value");
228 db.write("key","value"); 228 db.write("key","value");
229 229
@@ -246,7 +246,7 @@ private Q_SLOTS:
246 bool gotError = false; 246 bool gotError = false;
247 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); 247 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true);
248 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 248 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
249 auto db = transaction.openDatabase(); 249 auto db = transaction.openDatabase("default", nullptr, true);
250 db.write("key","value1"); 250 db.write("key","value1");
251 db.write("key","value2"); 251 db.write("key","value2");
252 int numValues = db.scan("key", [&](const QByteArray &key, const QByteArray &value) -> bool { 252 int numValues = db.scan("key", [&](const QByteArray &key, const QByteArray &value) -> bool {