Startup Performance degradation for Unified Folders caused by bug 1847401
Categories
(Thunderbird :: Folder and Message Lists, defect)
Tracking
(thunderbird_esr115 fixed)
Tracking | Status | |
---|---|---|
thunderbird_esr115 | --- | fixed |
People
(Reporter: betterbird.project+10, Assigned: darktrojan)
References
(Regression)
Details
(Keywords: perf, regression, Whiteboard: [regression: 115.2.3/118.0b5])
Attachments
(2 files)
65.99 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr115+
|
Details | Review |
+++ This bug was initially created as a clone of Bug #1847401 +++
TB 115.2.3 shows a significant performance degradation at startup on a profile with about ~1500 folders.
Profiling shows that a lot of time is spent in getRowForFolder() and its query selector code.
Looks like the code added has a performance of O(n^2) in initServer() since in a loop over the folders, all folders in the tree are visited.
If now takes about 8 seconds to show the first window. Note that in the picture the red bars are labelled as yanks.
Reporter | ||
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
Updated•1 year ago
|
Reporter | ||
Comment 2•1 year ago
|
||
This is certainly better. However, there are still mass operations run in loops:
initServer(server) {
// Find all folders in this server that aren't currently displayed.
let existingRows = new Set(
Array.from(
this.containerList.getElementsByTagName("li"),
li => li.uri
)
);
console.log("=== initServer existingRows.size (1)", existingRows.size);
let remainingFolderURIs = server.rootFolder.descendants
.map(folder => folder.URI)
.filter(folderURI => !existingRows.has(folderURI));
console.log("=== initServer remainingFolderURIs.length (1)", remainingFolderURIs.length);
while (remainingFolderURIs.length) {
let folderURI = remainingFolderURIs.shift();
let folder = MailServices.folderLookup.getFolderForURL(folderURI);
if (folderPane._isGmailFolder(folder)) {
continue;
}
this.addFolder(folderPane._getNonGmailParent(folder), folder);
existingRows = new Set(
Array.from(
this.containerList.getElementsByTagName("li"),
li => li.uri
)
);
console.log("=== initServer existingRows.size (2)", existingRows.size);
remainingFolderURIs = remainingFolderURIs.filter(
folderURI => !existingRows.has(folderURI)
);
console.log("=== initServer remainingFolderURIs.length (2)", remainingFolderURIs.length);
}
},
existingRows
and remainingFolderURIs
are constantly rebuilt and their sizes increase/decrease each time. Instead of rebuilding those arrays, can the existing arrays be used?
Assignee | ||
Updated•1 year ago
|
Pushed by martin@humanoids.be:
https://hg.mozilla.org/comm-central/rev/a9682111c027
Improve perfomance of Unified Folder mode initialisation. r=freaktechnik
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Comment on attachment 9354036 [details]
Bug 1854035 - Improve perfomance of Unified Folder mode initialisation. r=freaktechnik
[Triage Comment]
Approved for beta
Comment 5•11 months ago
|
||
Comment on attachment 9354036 [details]
Bug 1854035 - Improve perfomance of Unified Folder mode initialisation. r=freaktechnik
[Triage Comment]
Approved for esr115 per matrix
Comment 6•11 months ago
|
||
bugherder uplift |
Thunderbird 115.4.0:
https://hg.mozilla.org/releases/comm-esr115/rev/7701c25dd390
Updated•11 months ago
|
Updated•4 months ago
|
Assignee | ||
Updated•4 months ago
|
Updated•4 months ago
|
Description
•