Revision 6123b9f...

Go back to digest for 1st December 2013

Optimization in KDE-PIM

Jan Kundrát committed changes in [trojita] src/Imap/Tasks/ObtainSynchronizedMailboxTask.cpp:

tree: preallocate memory for all TreeItemMessage instances during the mailbox sync

There is no measurable performance change on my test setup, which is expected --
the amortized cost of reallocating is still O(1) per element, i.e. O(n) for the
mailbox as a whole, and pointer copying is dwarfed by the overhead of dynamic
allocation of the actual nodes and other useful work, but it's still good style
to preallocate what is known to be needed in future.

Thanks to Thomas Lübking for suggesting this.

REVIEW: 114124

File Changes

Modified 1 files
  • src/Imap/Tasks/ObtainSynchronizedMailboxTask.cpp
1 files changed in total