Open Bug 1864247 Opened 11 months ago Updated 11 months ago

Fix performance regression for search folders caused by bug 1846885

Categories

(Thunderbird :: Folder and Message Lists, defect)

Thunderbird 115
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: betterbird.project+12, Unassigned)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

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

Bug 1846885 should have used the first version of the patch:
https://phabricator.services.mozilla.com/D185238?vs=on&id=750056#toc

This code here:
https://hg.mozilla.org/releases/comm-esr115/rev/ffd49506d62c#l2.15
causes a significant performance regression for search folders:
https://searchfox.org/comm-central/rev/b20a8a71f829d3e24257d6072129254ee6682ca3/mailnews/base/src/nsMsgSearchDBView.cpp#344
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:
https://searchfox.org/comm-central/rev/b20a8a71f829d3e24257d6072129254ee6682ca3/mail/base/content/aboutMessage.js#195

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:
https://searchfox.org/comm-central/rev/f03f68a187cad017819657991b2fc67817b9887e/mailnews/base/src/nsMsgSearchDBView.cpp#1130, 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.

Attachment

General

Created:
Updated:
Size: