[Kde-pim] Still hunting for speed: now CollectionSyncProgressRole

David Faure faure at kde.org
Sat Oct 11 19:07:03 BST 2014


In commit bdb4102b92 for kdepimlibs, Tobias Koenig added
CollectionSyncProgressRole to the ETM, which represents the progress of the 
sync for the folder. This data is updated very often during an imap sync.

E.g. my debug output shows:
Collection QVariant(QString, "kde-pim") progress percent= 19 
Collection QVariant(QString, "kde-pim") progress percent= 23 
Collection QVariant(QString, "kde-pim") progress percent= 27 
Collection QVariant(QString, "kde-pim") progress percent= 30 
Collection QVariant(QString, "kde-pim") progress percent= 34 
Collection QVariant(QString, "kde-pim") progress percent= 38 
Collection QVariant(QString, "kde-pim") progress percent= 42 
Collection QVariant(QString, "kde-pim") progress percent= 46 
Collection QVariant(QString, "kde-pim") progress percent= 50 

The problem is that it leads to emitting dataChanged(index) in the ETM,
which triggers the many layers of proxymodels on top of that model.
I once ended up in a 80 levels call stack from that signal...
QElapsedTimer says every one of these dataChanged calls takes 50ms on average.
Surely this can't help for speed, especially since we *never ever* use
that information in the GUI (the sync progress is shown in the kmail 
statusbar, not in a view connected to the ETM).

The reason we have CollectionSyncProgressRole is only for the QML
GUI (Kontact Mobile).

kdepim-runtime/qml/akonadi/CollectionDelegate.qml says:
width: ((parent.width * (model.collectionSyncProgress == 100 ? 0 : 
   model.collectionSyncProgress)) / 100)

=>

* Do we still support Kontact Mobile?

* If so, can we come up with a better way to show the sync progress in the 
GUI, without it coming from ETM?

* Or maybe I should just add a boolean setter in the ETM, say
  setSyncProgressRoleEnabled(bool b), off by default, and only enable
  that in kdepim-runtime/qml somehow? (don't know where, it doesn't
  seem to use ETM directly....)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list