Closed Bug 1844381 Opened 1 year ago Closed 6 months ago

Slow Unified Inbox on startup/initial entry and switching folders. 25,000 messages

Categories

(Thunderbird :: Folder and Message Lists, defect, P2)

Thunderbird 116

Tracking

(thunderbird_esr115 affected)

RESOLVED DUPLICATE of bug 1875577
Tracking Status
thunderbird_esr115 --- affected

People

(Reporter: johnlangone, Unassigned)

References

Details

(Keywords: dupeme, perf, triaged)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Steps to reproduce:

Card view, sorted by date, group by sort on unified inbox (~25k messages).

Actual results:

Switching between folders and returning to the unified inbox grouped by sort results in about a 30 second freeze where Thunderbird is unresponsive. Toggling the option on and off works instantly. Problem occurs when toggling between different folders to a grouped by sort folder.

Expected results:

Not freeze.

Summary: Group by sort causes unresponsiveness. → Group by sort causes freezing.
Component: Untriaged → Folder and Message Lists
Keywords: perf

Toggling the option on and off works instantly.

You mean changing from Grouped to non-grouped?
And this is with both cards and table view?

Flags: needinfo?(johnlangone)

Changing from Grouped to non-grouped is OK on the selected folder.
The problem arises when changing holders where the first selected folder is non-grouped changing to a grouped folder.

The attached is a video demonstrating my unified inbox's sort settings/groupings. I switch to a single account folder (non-grouped), no hickups. I then go back to the unified inbox (grouped) and you will see the hang. Included Task manager so you can see the processes working.

https://www.youtube.com/watch?v=VfgReY5BIps

As a side bar, after deleting an email within the Today group for instance, the count breaks. see included screenshot. In the first example, it shows a wrong amount of new being displayed. In the second screenshot, you can see that Today turns into "Older".

Screenshot 1: https://snipboard.io/6X4jWz.jpg
Screenshot 2: https://snipboard.io/L10EoM.jpg

Flags: needinfo?(johnlangone)

Please use https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance to get a performance profile. Thanks.

Flags: needinfo?(johnlangone)
Keywords: dupeme
Summary: Group by sort causes freezing. → Group by sort causes freezing. Unified Inbox. 25,000 messages

Requested performance profile:
https://share.firefox.dev/3QnQ6r9

Interesting note. When in unified inbox, toggling between group by date and just threaded works instantly. It only happens when changing between folders. (And when you initially start TB and opening up into unified inbox)

Flags: needinfo?(johnlangone)

Using config editor try setting mail.db.max_open and mail.db.idle_limit to larger values. For example doubled.

Summary: Group by sort causes freezing. Unified Inbox. 25,000 messages → Group by sort causes folder freezing. Unified Inbox. 25,000 messages

Doubling the values and restarting had no affect.

Summary: Group by sort causes folder freezing. Unified Inbox. 25,000 messages → Group by sort causes 30 second delay. Unified Inbox. 25,000 messages

I think this also affects version 115 - we have quite a few support postings.

(In reply to John from comment #4)

Interesting note. When in unified inbox, toggling between group by date and just threaded works instantly. It only happens when changing between folders. (And when you initially start TB and opening up into unified inbox)

Analysis of performance profile https://share.firefox.dev/3QnQ6r9 via matrix

julienw
PR_Now is called a lot, presumably returns the same thing or near
Otherwise there's a lot of allocations

jesup
Sort algorithm may play into it. Also: 50% is nsMsgDatabase::CreateMsgHdr() - but half of that is ::~nsMsgHeader, and most of the rest of that is in new() or ::nsMsgHeader, so it's creating and destroying a zillion of those

mstange
It's the msgIndex = FindHdr(msgHdr, 0, true); call that's probably not intended to be slow
FindHdr ends up going through a lot of rows and creates headers for each of them
but we're looking for msgHdr which is an object that already exists, so really, we don't want to create any new header objects
so yeah I'd say the problem is "nsMsgSearchDBView::FindHdr does too much unnecessary work"
It causes Hdrs to be created when we're only looking for an existing Hdr
and it also causes repeated calls to nsMsgDBFolder::GetMsgDatabase

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: triaged
Priority: -- → P2
See Also: → 1830145
Summary: Group by sort causes 30 second delay. Unified Inbox. 25,000 messages → Slow Unified Inbox on startup/initial entry and switching folders. 25,000 messages

Does comment 9 inform a potential solution?

Flags: needinfo?(mkmelin+mozilla)
See Also: → 462349

Geoff/Magnus, which items do you reckon are are most actionable?

Flags: needinfo?(mkmelin+mozilla)
See Also: → 1860529
See Also: → 1836084

Comment 9 could be actionable.

Flags: needinfo?(mkmelin+mozilla)

(In reply to John from comment #6)

Doubling the values and restarting had no affect.

Do you see a difference when the groups are collapsed (by F10 -> View -> Threads -> Collapse All Threads or simply \) before you reopen the folder?

Flags: needinfo?(johnlangone)
See Also: → 1875577

Sorry I haven't contributed in a while. Because of the unbearable lag, i reorganized my mail boxes and reduced inboxes down to 6k emails and things were tolerable. 124.0b1 made a noticeable improvement and after 124.0b2, I believe the lag is non-existent. I think you guys fixed it.

Thanks!

Flags: needinfo?(johnlangone)

Thanks for the update, John.

Bug 1875577 was a big part of 124.0b1

Status: NEW → RESOLVED
Closed: 6 months ago
Duplicate of bug: 1875577
Resolution: --- → DUPLICATE
See Also: 462349
You need to log in before you can comment on or make changes to this bug.