Use Key API in indexes
ClosedPublic

Authored by rnicole on Jul 5 2018, 1:44 PM.

Details

Summary
  • Only in TypeIndex, not in Index (since we might want to store something other than identifiers as values)
  • We might want to do the same in the SynchronizerStore for localId ↔ remoteId indexes

Depends on D13735

Some quick benchmarks (against develop and D13735):

Diff Detail

Repository
R9 Sink
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rnicole requested review of this revision.Jul 5 2018, 1:44 PM
rnicole created this revision.
cmollekopf accepted this revision.Jul 6 2018, 10:14 AM

Looks good to me.

This revision is now accepted and ready to land.Jul 6 2018, 10:14 AM
rnicole updated this revision to Diff 37241.Jul 6 2018, 11:07 AM

Increment database version

rnicole added a comment.EditedJul 10 2018, 11:33 AM

Some disk statistics:

Account 1: a lot of mails, but mostly text (occasional big attachments)
Account 2: a good number of mails, but mostly HTML heavy messages, with images, etc.

Results of the Dummy resource write benchmark:

Some interesting bits:

Run benchmarks

BeforeAfter
Current Rss usage [kb]: 40700Current Rss usage [kb]: 38484
Peak Rss usage [kb]: 40700Peak Rss usage [kb]: 38484
Rss growth [kb]: 15920Rss growth [kb]: 13660
Rss growth per entity [byte]: 3260Rss growth per entity [byte]: 2797
Rss without db [kb]: 29736Rss without db [kb]: 29504
Percentage peak rss error: 0Percentage peak rss error: 0
On disk [kb]: 10788On disk [kb]: 8804
Buffer size total [kb]: 898Buffer size total [kb]: 898
Write amplification: 12.0075Write amplification: 9.79923

Test Disk Usage:

BeforeAfter
Free pages: 412Free pages: 312
Total pages: 760Total pages: 607
Used size: 1425408Used size: 1208320
Calculated key + value size: 856932Calculated key + value size: 702866
Calculated total db sizes: 970752Calculated total db sizes: 950272
Main store on disk: 3112960Main store on disk: 2486272
Total on disk: 3293184Total on disk: 2666496
Used size amplification: 1.66339Used size amplification: 1.71913
Write amplification: 3.63268Write amplification: 3.53733

The benchmark matches the expectations I'd say

I'd say so too! But I'm still not sure why the disk statistics are so underwhelming :-/

I'd say so too! But I'm still not sure why the disk statistics are so underwhelming :-/

Yeah, those seem wrong to be honest. The only way those numbers make any sense if the uid size is completely dwarfed by the rest of the data, but that has not been our experience so far.

This revision was automatically updated to reflect the committed changes.