Skip to content

Speed up thread sort when many long threads exist

score requested to merge score/mutt:thread_sort_speedup into master

This caches the number of hidden messages instead of recalculating per message per thread.


I was experiencing very long wait times after switching to old mailboxes with giant inboxes. There were some large threads which resulted in a slowdown of around an hour when waiting to open the mailbox. This brings it back down to a few seconds (minus message header fetching).

I have not dived too deeply into the code, so if there is an existing mechanism by which this could be cached, or if the cache invalidation in mutt_set_virtual is unnecessary, please inform me.

Merge request reports