[Kde-pim] Review Request 122321: FavoriteCollectionsModel: avoid calling reference() all the time

David Faure faure at kde.org
Thu Jan 29 23:28:57 GMT 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122321/#review75017
-----------------------------------------------------------


BTW would there be a way to clean up dead collection IDs, or is that impossible because everything is async and they might come up at any time later, i.e. we never know when we have loaded everything?

(but well, we could also ask the MySQL DB, no? and clean up dangling IDs).

If we could do that, then we could also stop calling "reload()" when we reach the desired amount of favorites that we're trying to select...
That would just rock, performance-wise....

- David Faure


On Jan. 29, 2015, 11:26 p.m., David Faure wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122321/
> -----------------------------------------------------------
> 
> (Updated Jan. 29, 2015, 11:26 p.m.)
> 
> 
> Review request for KDEPIM-Libraries and Christian Mollekopf.
> 
> 
> Repository: kdepimlibs
> 
> 
> Description
> -------
> 
> For some reason I have some non-existing collection IDs in my config
> for favorites, so every call to reload() calls insertIfAvailable(dead_id)
> which called reference(dead_id), ending up in EntityTreeModelPrivate::indexForCollection
> where quite some iteration and linear searching happens.
> 
> => only reference() if we were actually able to select(), i.e.
> if the collection was found.
> This cuts by half the number of calls to indexForCollection, at least.
> 
> 
> Diffs
> -----
> 
>   akonadi/favoritecollectionsmodel.cpp d5414b941bf838d0353dc7c6bf67302d06872ec9 
> 
> Diff: https://git.reviewboard.kde.org/r/122321/diff/
> 
> 
> Testing
> -------
> 
> Running kmail, with debug output in select and reference, and in deselect and dereference. In my tests (including adding/removing a favorite) everything was called correctly.
> 
> 
> Thanks,
> 
> David Faure
> 
>

_______________________________________________
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