summaryrefslogtreecommitdiffstats
path: root/common/index.h
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 /common/index.h
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 'common/index.h')
-rw-r--r--common/index.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/index.h b/common/index.h
index 08b499f..e1b7e3a 100644
--- a/common/index.h
+++ b/common/index.h
@@ -26,6 +26,7 @@ public:
26 }; 26 };
27 27
28 Index(const QString &storageRoot, const QString &name, Akonadi2::Storage::AccessMode mode = Akonadi2::Storage::ReadOnly); 28 Index(const QString &storageRoot, const QString &name, Akonadi2::Storage::AccessMode mode = Akonadi2::Storage::ReadOnly);
29 Index(const QByteArray &name, Akonadi2::Storage::Transaction &);
29 30
30 void add(const QByteArray &key, const QByteArray &value); 31 void add(const QByteArray &key, const QByteArray &value);
31 // void remove(const QByteArray &key, const QByteArray &value); 32 // void remove(const QByteArray &key, const QByteArray &value);
@@ -35,5 +36,6 @@ public:
35 36
36private: 37private:
37 Q_DISABLE_COPY(Index); 38 Q_DISABLE_COPY(Index);
38 Akonadi2::Storage mStorage; 39 Akonadi2::Storage::Transaction mTransaction;
40 Akonadi2::Storage::NamedDatabase mDb;
39}; 41};