D14242: Significant performance increase for specific use conditions

Alexander Stein noreply at phabricator.kde.org
Fri Jul 20 09:25:55 BST 2018


steinalexander created this revision.
Restricted Application added a project: KDE PIM.
Restricted Application added a subscriber: kde-pim.
steinalexander requested review of this revision.

REVISION SUMMARY
  Consider the following conditions:
  
  - a mail folder containg a lot (>20000) mail (e.g. lkml mails archived for 20 days)
  - threaded view
  
  Depending where your current view is located (top or bottom of scroll list), expanding/collapsing all threads is either fast (~2s on my machine) or extremely slow (>15mins).
  The reason is that in View::setAllThreadsExpanded() for all children setChildrenExpanded() is called which eventually causes a redraw for each item due to collapse/expand. This might also cause updating the model view due to increased/decreased total amount.
  E.g. if the current view is at the bottom every collapse causes a redraw because the total lines in the message list is decrementing. If the current view is at the top this effect only kicks for the first items until the further changes are out of view.
  I profiled those step once using perf. The result was about ~72% just qt_memfill32 due to Pixmap redrawal caused by MessageList::Core::View::setChildrenExpanded.
  
  Fix this by calling scheduleDelayedItemsLayout() beforehand. This delays the redraw until tree traversal has finished (actually until event loop is entered again). Using this patch the collapse is finished in <<1s, indepentently where the current view position is. Actually the time is not really measurable.
  While at it, also call scheduleDelayedItemsLayout() in View::setAllGroupsExpanded() which also might touch a lot of items.

REPOSITORY
  R94 PIM: Message Library

REVISION DETAIL
  https://phabricator.kde.org/D14242

AFFECTED FILES
  messagelist/src/core/view.cpp

To: steinalexander
Cc: kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20180720/21942d89/attachment.html>


More information about the kde-pim mailing list