Summary: | Telepathy contactlist is too fast to filter/search as you type; makes UI unresponsive on 1000s contacts | ||
---|---|---|---|
Product: | [Unmaintained] telepathy | Reporter: | Fabio Correa <facorread> |
Component: | contactlist | Assignee: | Telepathy Bugs <kde-telepathy-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | minor | CC: | kde, mklapetek |
Priority: | NOR | ||
Version: | 0.8.0 | ||
Target Milestone: | Future | ||
Platform: | Kubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Callgrind logs for filtering |
Description
Fabio Correa
2014-04-18 02:47:12 UTC
Thanks for the report. I can confirm this happening. I guess we could add a simple if (contacts.size() > 500) { delaySearching(); } Btw. in the meantime you can also use KRunner to search for your contacts, that should be way more responsive ;) We've made some parts of the model faster. Please retest to see if this is actually needed. Thanks for your work. Tested your git commit 593a1a48 and there's no change in search responsiveness. Thanks. Can you check you have 1417fd90f1b07de2badf3cf4ff208c8da1702c60 in libkpeople too? This is the one that makes data() faster, the commit you linked was purely for grouping. I'd like to try and optimise before we add in a workaround; it'll make all the things faster. There was some work to do in the KTpTranslationProxyModel. Sorry; I was using the downstream libraries. I compiled the libkpeople master and the situation improved considerably; search took ~3 seconds before, now it takes ~1 sec on the first letter. I've got a callgrind output from just the filtering. We are spending a /lot/ of time in QImage::load() (30% of my time filtering) we call it more often that we call paintRow. Which means something is wrong. QPixmap has an implicit cache when given a path, QImage does not; we are probably loading a whole image every time we repaint. We spend 9% of the time in QPixmap::scaled() so maybe we should keep a QPixmapCache of the scaled avatars. That really means changing the API from libkpeople, as we would need some sort of string identifier for the image. Lets fix that, it'll probably give us a boost, and then we can look and see if we need to optimise anything else. Created attachment 86320 [details]
Callgrind logs for filtering
We spend another 9% of the time in KTp::dataForKtpContact. This code is relatively slow; which is fine as it's only meant to be used when we are invoking an action. The sorting function includes ContactClientTypesRole, which goes via this function, it ends up getting called > 9000 times whilst I was searching. If we proxy the clientTypes as a custom field in libkpeople we will save a lot. Sorry for the noise:
>That really means changing the API from libkpeople, as we would need some sort of string identifier for the image.
Edit: QPixmap::cacheKey solves that.
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved. Dear user, unfortunately Telepathy is no longer maintained. Please migrate to another solution, e.g. for Jabber a possibility is Kaidan, for Matrix a candidate is NeoChat. |