Open Bug 1864247 Opened 7 months ago Updated 7 months ago

Fix performance regression for search folders caused by bug 1846885


(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 115


(Not tracked)



(Reporter: betterbird.project+12, Unassigned)




(Keywords: regression)


(1 file)

+++ This bug was initially created as a clone of Bug #1846885 +++

Bug 1846885 should have used the first version of the patch:

This code here:
causes a significant performance regression for search folders:
as the operation is very expensive and also leaves all the databases open which is rather counterproductive when looking at fixing bug 1554188.

In general, all callers of nsMsgDBView::FindIndexOfMsgHdr() (which calls nsMsgDBView::FindHdr()) now potentially suffer performance issues and cause more open databases. Even displaying a message in a search folder now visits all the folders/databases it is made up of:

Keywords: regression
Regressed by: 1846885
Attached image 1864247.png

Screenshot of profiling of this case. User was simply selecting messages in search folder spanning apparently 56 mailboxes.

Some correction is needed here: For search views, FindHdr() is overridden here:, sadly that's not visible in the performance profile. A profile with all function names shows nsMsgDBView::FindIndexOfMsgHdr() calling nsMsgSearchDBView::FindHdr().

That said, we would still advise to deploy our patch which restores the initial proposal from bug 1846885 since the backend change isn't warranted just to save one line of JS in the frontend for a very uncommon operation to select a message by header from the click onto a new message notification.

You need to log in before you can comment on or make changes to this bug.