Revision 5cd12fd...

Go back to digest for 9th November 2014

Optimization in KDE-PIM

Gerrit Test Instance Operator committed changes in [trojita] /Imap/Model:

Speed up rechecking of message flags

The old code was calling QString's operator==, which in the end leads to
comparing stuff byte-by-byte just to see if they happen to be the same
(with, I hope, a quick path for comparing identical objects). However,
we have an architecture which guarantees that the system flags are
always implicitly shared, and hence their D-pointers are the same.

This change speeds up things at least by a factor of two by comparing
the D-pointers directly. As a bonus, it also adds an optimization for a
special case of TreeItemMsgList::recalcVariousMessageCounts by looking
for the two flags which are needed at once.

Change-Id: Ie240307550b3c11f8c782493194bbe7ac0c5fed8

File Changes

Modified 2 files
  • /Imap/Model
  •   src/MailboxTree.cpp
  •   src/MailboxTree.h
2 files changed in total