Do not load target folder if no periodic filters exist
Categories
(MailNews Core :: Filters, defect)
Tracking
(thunderbird68 fixed, thunderbird69 fixed)
People
(Reporter: aceman, Assigned: aceman)
References
(Depends on 1 open bug)
Details
(Keywords: perf)
Attachments
(1 file)
2.46 KB,
patch
|
mkmelin
:
review+
jorgk-bmo
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
At https://searchfox.org/comm-central/rev/9fa0de5c8d0841f5aa26e91d941264f42ad1c81c/mailnews/base/search/src/PeriodicFilterManager.jsm#78 we have code like this:
let foldersToFilter = server.rootFolder.getFoldersWithFlags(Ci.nsMsgFolderFlags.Inbox);
if (!foldersToFilter.length)
continue;
....
for (let i = 0; i < numFilters; i++) {
let curFilter = curFilterList.getFilterAt(i);
// Only add enabled, UI visible filters that are of the Periodic type.
if (curFilter.enabled && !curFilter.temporary &&
(curFilter.filterType & Ci.nsMsgFilterType.Periodic)) {
tempFilterList.insertFilterAt(newFilterIndex, curFilter);
}
}
MailServices.filters.applyFiltersToFolders(tempFilterList, foldersToFilter, null);
Before we enumerate the periodic filters to run (if any) we first lookup the Inbox folder of the server. This basically adds the Inbox folders of ALL accounts to the folder cache. The cache is quite small (30 folders by default). If you have many accounts , even some "dead" ones, for which no mail is fetched or no filters defined, this may push out useful folders out of the cache. It may be expensive to reload those other folders again.
We could try to avoid loading the Inbox folders for accounts that have no periodic filters to run.
Comment 1•5 years ago
|
||
nit - If this is a performance issue to bug 864187 then I'd call this a defect and not an enhancement.
First check if there are any periodic filters, then get folders.
Comment 3•5 years ago
|
||
Comment on attachment 9067646 [details] [diff] [review] 1554424.patch Review of attachment 9067646 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, r=mkmelin
Updated•5 years ago
|
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/19ec36793dc9
do not periodically load Inbox folder for account that has no periodic filters defined. r=mkmelin
Updated•5 years ago
|
Comment 6•5 years ago
|
||
Description
•