Performance improvement for VCardTool, which was filling two QMaps in the constructor.
ClosedPublic

Authored by dfaure on Dec 20 2016, 9:30 PM.

Details

Summary

And the constructor is called very often - once for each contact being {de}serialized
by Akonadi (see VCardConverter::parseVCards).

Fixed by the usual "static const struct" readonly-data solution (from Marc Mutz in libkleo).

I hit this when using the "Select..." pushbutton in kmail composer, which fills in a model
with all contacts.

Test Plan

Validated by the unittests (which are the reason why I had to sort both lists
alphabetically, to match the ordering that was done by QMap previously).

Diff Detail

Repository
R174 KContacts
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
dfaure updated this revision to Diff 9237.Dec 20 2016, 9:30 PM
dfaure retitled this revision from to Performance improvement for VCardTool, which was filling two QMaps in the constructor..
dfaure edited the test plan for this revision. (Show Details)
dfaure added a reviewer: mlaurent.
dfaure updated this object.
Restricted Application added a project: KDE PIM. · View Herald TranscriptDec 20 2016, 9:30 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
mlaurent accepted this revision.Dec 21 2016, 7:01 AM
mlaurent edited edge metadata.

Thanks for it.
+2 :)
Ship it.

This revision is now accepted and ready to land.Dec 21 2016, 7:01 AM
dfaure closed this revision.Dec 21 2016, 7:35 AM