Review Request 114349: Use one Akonadi::EntityTreeModel instead of Akonadi::Monitors in AkonadiDataSource

Dan Vrátil dvratil at redhat.com
Sun Dec 8 02:48:05 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114349/
-----------------------------------------------------------

(Updated Dec. 8, 2013, 3:48 a.m.)


Review request for Telepathy.


Changes
-------

Fix a comment, optimize ItemFetchScope of the Monitor.


Repository: libkpeople


Description
-------

Use a single ETM instead of manually fetching all contacts and then installing a new Akonadi Monitor for each single AkonadiContact.

ETM (with EntityMimeTypeFilterModel on top) will do the CollectionFetchJobs and ItemFetchJobs and data handling for us, which only leaves us with handling of changes, which we do in slots for QAbstractItemModel's rowsInserted(), rowsRemoved() and dataChanged() signals. This is much better than having many Akonadi monitors, because for each change notification that Akonadi server generates, it has to iterate over all registered monitors and compare the notification against each monitor's filter. With lots of monitors, this can impact performance of the server. Although the AkonadiContacts with their Akonadi monitors are created on demand (so there's none at the beginning), they are not removed (probably cached somewhere in PersonsModel), so the number of active Akonadi monitors tends to grow - for instance going through all contacts in PersonViewer will leave you with one monitor for each contact fed from Akonadi.

>From Akonadi POV, having one properly configured monitor (hidden in ETM) and working with data via ETM is a better approach.


Diffs (updated)
-----

  CMakeLists.txt 889e96d 
  src/plugins/akonadi/akonadidatasource.h b09edf8 
  src/plugins/akonadi/akonadidatasource.cpp 193de78 

Diff: http://git.reviewboard.kde.org/r/114349/diff/


Testing
-------

Going through all contacts in PersonViewer includes all contacts from Akonadi, and the application uses only one Akonadi Monitor all the time.


Thanks,

Dan Vrátil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20131208/f0146978/attachment.html>


More information about the KDE-Telepathy mailing list