diff options
author | Rémi Nicole <nicole@kolabsystems.com> | 2018-07-27 13:40:03 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-07-27 13:48:03 +0200 |
commit | c741d7fbb21ff959ca4b6d4f7681aead277044b4 (patch) | |
tree | 5ba510e9d794aea0d689bde08f44fece7fc129e4 /common/queryrunner.cpp | |
parent | 0a9b39a1f58c1f5b1a424acbe369db520a12df42 (diff) | |
download | sink-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/queryrunner.cpp')
-rw-r--r-- | common/queryrunner.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index 9ac3517..7d6d279 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -271,7 +271,14 @@ void QueryWorker<DomainType>::resultProviderCallback(const Sink::Query &query, S | |||
271 | for (auto it = result.aggregateValues.constBegin(); it != result.aggregateValues.constEnd(); it++) { | 271 | for (auto it = result.aggregateValues.constBegin(); it != result.aggregateValues.constEnd(); it++) { |
272 | valueCopy->setProperty(it.key(), it.value()); | 272 | valueCopy->setProperty(it.key(), it.value()); |
273 | } | 273 | } |
274 | valueCopy->aggregatedIds() = result.aggregateIds; | 274 | valueCopy->aggregatedIds() = [&] { |
275 | QVector<QByteArray> aggregateIdsBA; | ||
276 | aggregateIdsBA.reserve(result.aggregateIds.size()); | ||
277 | for (const auto &id : result.aggregateIds) { | ||
278 | aggregateIdsBA << id.toDisplayByteArray(); | ||
279 | } | ||
280 | return aggregateIdsBA; | ||
281 | }(); | ||
275 | if (mResultTransformation) { | 282 | if (mResultTransformation) { |
276 | mResultTransformation(*valueCopy); | 283 | mResultTransformation(*valueCopy); |
277 | } | 284 | } |