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


(Thunderbird :: Search, defect)



(thunderbird_esr78 wontfix)

82 Branch
Tracking Status
thunderbird_esr78 --- wontfix


(Reporter: standard8, Assigned: standard8)


(Blocks 1 open bug)


(Keywords: perf)


(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
Move msgMail3PaneWindow functions onLoadMessenger and onUnloadMessenger into their own gMailInit object. r=mkmelin
Create a mail window delayed startup function and move various items into it. r=mkmelin
Only run MailnewsMigrator once on startup and make it more efficient when not needing to do migrations. r=mkmelin

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.