mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-25 08:35:16 +08:00
[client-app] delay building new hot window to improve win perf
Summary: This improves window open times by about 70ms We would spend a very long time in the backend browser process building a new hot window when we didn't need to do that until much later Test Plan: manual Reviewers: halla, mark, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4311
This commit is contained in:
parent
590b17ae6f
commit
4deef8b90c
1 changed files with 6 additions and 1 deletions
|
@ -48,7 +48,6 @@ export default class WindowLauncher {
|
|||
this.createHotWindow()
|
||||
}
|
||||
win = this.hotWindow;
|
||||
this.createHotWindow();
|
||||
|
||||
const newLoadSettings = Object.assign({}, win.loadSettings(), opts)
|
||||
if (newLoadSettings.windowType === WindowLauncher.EMPTY_WINDOW) {
|
||||
|
@ -70,6 +69,12 @@ export default class WindowLauncher {
|
|||
}
|
||||
|
||||
win.setLoadSettings(newLoadSettings);
|
||||
|
||||
setTimeout(() => {
|
||||
// We need to regen a hot window, but do it in the next event
|
||||
// loop to not hang the opening of the current window.
|
||||
this.createHotWindow();
|
||||
}, 0)
|
||||
}
|
||||
|
||||
if (!opts.hidden && !opts.initializeInBackground) {
|
||||
|
|
Loading…
Reference in a new issue