summaryrefslogtreecommitdiffstats
path: root/common/datastorequery.cpp
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-07-27 13:40:03 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-27 13:48:03 +0200
commitc741d7fbb21ff959ca4b6d4f7681aead277044b4 (patch)
tree5ba510e9d794aea0d689bde08f44fece7fc129e4 /common/datastorequery.cpp
parent0a9b39a1f58c1f5b1a424acbe369db520a12df42 (diff)
downloadsink-c741d7fbb21ff959ca4b6d4f7681aead277044b4.tar.gz
sink-c741d7fbb21ff959ca4b6d4f7681aead277044b4.zip
Use Key API in ResultSet
Summary: Depends on D14099 Notes: - Tests pass without many modifications outside of resultset.cpp/.h - `mGenerator` doesn't seem to be used? Benchmarks ========= Run benchmarks: | Develop | D14099 | This patch | | ---------------------------------- | ---------------------------------- | ---------------------------------- | | Current Rss usage [kb]: 40700 | Current Rss usage [kb]: 38564 | Current Rss usage [kb]: 39112 | | Peak Rss usage [kb]: 40700 | Peak Rss usage [kb]: 38564 | Peak Rss usage [kb]: 39112 | | Rss growth [kb]: 15920 | Rss growth [kb]: 13352 | Rss growth [kb]: 13432 | | Rss growth per entity [byte]: 3260 | Rss growth per entity [byte]: 2734 | Rss growth per entity [byte]: 2750 | | Rss without db [kb]: 29736 | Rss without db [kb]: 29248 | Rss without db [kb]: 30100 | | Percentage peak rss error: 0 | Percentage peak rss error: 0 | Percentage peak rss error: 0 | | On disk [kb]: 10788 | On disk [kb]: 9140 | On disk [kb]: 8836 | | Buffer size total [kb]: 898 | Buffer size total [kb]: 898 | Buffer size total [kb]: 898 | | Write amplification: 12.0075 | Write amplification: 10.1732 | Write amplification: 9.83485 | Test Disk Usage: | Develop | D14099 | This patch | | ----------------------------------- | ----------------------------------- | ----------------------------------- | | Free pages: 412 | Free pages: 309 | Free pages: 312 | | Total pages: 760 | Total pages: 599 | Total pages: 603 | | Used size: 1425408 | Used size: 1187840 | Used size: 1191936 | | Calculated key + value size: 856932 | Calculated key + value size: 702866 | Calculated key + value size: 702866 | | Calculated total db sizes: 970752 | Calculated total db sizes: 954368 | Calculated total db sizes: 933888 | | Main store on disk: 3112960 | Main store on disk: 2453504 | Main store on disk: 2469888 | | Total on disk: 3293184 | Total on disk: 2633728 | Total on disk: 2650112 | | Used size amplification: 1.66339 | Used size amplification: 1.68999 | Used size amplification: 1.69582 | | Write amplification: 3.63268 | Write amplification: 3.49071 | Write amplification: 3.51402 | Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D14289
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r--common/datastorequery.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp
index aa315c6..52243da 100644
--- a/common/datastorequery.cpp
+++ b/common/datastorequery.cpp
@@ -271,7 +271,7 @@ public:
271 271
272 struct ReductionResult { 272 struct ReductionResult {
273 Identifier selection; 273 Identifier selection;
274 QVector<QByteArray> aggregateIds; 274 QVector<Identifier> aggregateIds;
275 QMap<QByteArray, QVariant> aggregateValues; 275 QMap<QByteArray, QVariant> aggregateValues;
276 }; 276 };
277 277
@@ -284,14 +284,14 @@ public:
284 for (auto &aggregator : mAggregators) { 284 for (auto &aggregator : mAggregators) {
285 aggregator.reset(); 285 aggregator.reset();
286 } 286 }
287 QVector<QByteArray> reducedAndFilteredResults; 287 QVector<Identifier> reducedAndFilteredResults;
288 for (const auto &r : results) { 288 for (const auto &r : results) {
289 readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) { 289 readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) {
290 //We need to apply all property filters that we have until the reduction, because the index lookup was unfiltered. 290 //We need to apply all property filters that we have until the reduction, because the index lookup was unfiltered.
291 if (!matchesFilter(entity)) { 291 if (!matchesFilter(entity)) {
292 return; 292 return;
293 } 293 }
294 reducedAndFilteredResults << r.toDisplayByteArray(); 294 reducedAndFilteredResults << r;
295 Q_ASSERT(operation != Sink::Operation_Removal); 295 Q_ASSERT(operation != Sink::Operation_Removal);
296 for (auto &aggregator : mAggregators) { 296 for (auto &aggregator : mAggregators) {
297 if (!aggregator.property.isEmpty()) { 297 if (!aggregator.property.isEmpty()) {