Closed Bug 1660904 Opened 1 year ago Closed 1 year ago

Investigate delaying initialisation of the search service until after the first window is created / during idle

Categories

(Thunderbird :: Search, defect)

defect

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
82 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: standard8, Assigned: standard8)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(3 files)

Currently the search service initialisation is kicked off before first paint. As the search service is only used in preferences and the context menu, that doesn't really need to be started until after Thunderbird has finished starting up.

We can probably do this after the window is displayed, maybe even during idle. Worst case, the user might have to wait briefly to display the context menu.

This starts to reflect what Firefox does with gBrowserInit in browser.js - for easier comparison and porting later.

Some of these could probably be moved out further, but for now this is a good starting point.

Depends on D89260

I noticed that on Mac, the MailnewsMigrator was being run twice due to the hidden window. It would also be run when a new window is openend.

We should just run this once. This also includes fixes for not loading items unless they are actually needed.

Depends on D89261

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/comm-central/rev/76d77cddd20f
Move msgMail3PaneWindow functions onLoadMessenger and onUnloadMessenger into their own gMailInit object. r=mkmelin
https://hg.mozilla.org/comm-central/rev/892b752e523d
Create a mail window delayed startup function and move various items into it. r=mkmelin
https://hg.mozilla.org/comm-central/rev/f85869d7ec15
Only run MailnewsMigrator once on startup and make it more efficient when not needing to do migrations. r=mkmelin

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

I'd think not for uplift, but open to suggestions.

(In reply to Magnus Melin [:mkmelin] from comment #5)

I'd think not for uplift, but open to suggestions.

Agreed, although there should be some, there's certainly not massive improvements here to make it worthwhile.

Severity: -- → S4

This not being uplifted caused bug 1674407 to fail on ESR (it uses gMailInit).

Is uplifting this a no-go?

I think it would be a bit scary to uplift. For that bug, you could probably hack it by adding a Services.obs.notifyObservers(window, "mail-delayed-startup-finished"); call at the right spot in the old code

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