diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-08 22:10:04 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-08 22:10:04 +0200 |
commit | 393846f660802d53d6ff6744cea0c1fa05019ba3 (patch) | |
tree | 2c8906240167af00838314d0b35907c87e4d40d5 /common/datastorequery.h | |
parent | 624fb3718b5063f29644b69a8082ef9f84a55ec5 (diff) | |
download | sink-393846f660802d53d6ff6744cea0c1fa05019ba3.tar.gz sink-393846f660802d53d6ff6744cea0c1fa05019ba3.zip |
Optimized the incremental update case.
This brings the incremental closer to a regular query (about 1.5 times
as bad instead of 3.5 times).
For a comparison look at MailQueryBenchmark::testIncremental()
The optimization is built on the assumption that we i.e. get an update
with 100 revisions, and thus the optimization applies to the case where
we have multiple revisions within that batch that are part of the same
reduction. In such a case we can avoid redoing the reduction lookup over
and over.
Diffstat (limited to 'common/datastorequery.h')
-rw-r--r-- | common/datastorequery.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/datastorequery.h b/common/datastorequery.h index de4ae26..cc501e6 100644 --- a/common/datastorequery.h +++ b/common/datastorequery.h | |||
@@ -107,11 +107,13 @@ public: | |||
107 | return mDatastore->indexLookup(property, value); | 107 | return mDatastore->indexLookup(property, value); |
108 | } | 108 | } |
109 | 109 | ||
110 | virtual void skip() { mSource->skip(); }; | 110 | virtual void skip() { mSource->skip(); } |
111 | 111 | ||
112 | //Returns true for as long as a result is available | 112 | //Returns true for as long as a result is available |
113 | virtual bool next(const std::function<void(const ResultSet::Result &)> &callback) = 0; | 113 | virtual bool next(const std::function<void(const ResultSet::Result &)> &callback) = 0; |
114 | 114 | ||
115 | virtual void updateComplete() { } | ||
116 | |||
115 | FilterBase::Ptr mSource; | 117 | FilterBase::Ptr mSource; |
116 | DataStoreQuery *mDatastore; | 118 | DataStoreQuery *mDatastore; |
117 | bool mIncremental = false; | 119 | bool mIncremental = false; |