Creating the hidden window lazily on non-Mac platforms
Categories
(Core :: General, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: Felipe)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [fxperf:p1][Snappy:P1]c=startup_misc u= p=)
Attachments
(19 files, 2 obsolete files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-github-pull-request
|
Details |
Updated•12 years ago
|
Updated•12 years ago
|
Comment 1•12 years ago
|
||
Comment 2•12 years ago
|
||
Comment 3•12 years ago
|
||
Reporter | ||
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Reporter | ||
Comment 6•12 years ago
|
||
Reporter | ||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
Reporter | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
Comment 12•12 years ago
|
||
Comment 13•12 years ago
|
||
Comment 14•12 years ago
|
||
Comment 15•12 years ago
|
||
Comment 16•12 years ago
|
||
Comment 17•12 years ago
|
||
Comment 18•12 years ago
|
||
Updated•12 years ago
|
Updated•9 years ago
|
Comment 19•8 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 20•6 years ago
|
||
This might be interesting for start-up performance work that the front-end team is working on this quarter. Putting back into triage.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 21•6 years ago
|
||
I'll update this patch and send to try (or try to reland it) to see what the impact is
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 22•6 years ago
|
||
So this is showing some good potential of ~1.5% to ~2.7% wins for ts_paint on Windows and Linux.
There are some big regressions in sessionstore tests because it's now paying the price of being the first to access the hidden window, but I think we can actually get rid of the hidden window usage by session restore (and several other pieces of code.. I'll be filing separate bugs for each case).
I've also seen some crashes by some core code that can't handle the window being just created if it's the first to access. I imagine the reference to the window is returned properly, but the DOM hasn't finished loading.. I'll need to investigate it.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 23•6 years ago
|
||
Assignee | ||
Comment 24•6 years ago
|
||
Assignee | ||
Comment 25•6 years ago
|
||
Assignee | ||
Comment 26•6 years ago
|
||
Assignee | ||
Comment 27•6 years ago
|
||
Assignee | ||
Comment 28•6 years ago
|
||
Assignee | ||
Comment 29•6 years ago
|
||
Assignee | ||
Comment 30•6 years ago
|
||
Assignee | ||
Comment 31•6 years ago
|
||
Assignee | ||
Comment 32•6 years ago
|
||
Assignee | ||
Comment 33•6 years ago
|
||
It doesn't need a high precision performance.now() to count minutes. In addition, if there are no windows to be closed, it's not doing anything, so it doesn't need to open a new one.
Assignee | ||
Comment 34•6 years ago
|
||
Assignee | ||
Comment 35•6 years ago
|
||
Assignee | ||
Comment 36•6 years ago
|
||
Assignee | ||
Comment 37•6 years ago
|
||
Assignee | ||
Comment 38•6 years ago
|
||
Assignee | ||
Comment 39•6 years ago
|
||
Here's an update where things stand on this bug:
I started out this bug with the goal to make the hidden window lazy and (A) not created before first paint. Then I went for a stretch goal of (B) not using the hidden window at all on a "normal" Firefox session (i.e., excluding corner features that might be harder to port).
Obviously, there are more blockers for (B) than for (A), and the most important performance improvement that we want (speeding up startup) relies on A, so I'll move (B) to a separate bug. That way, we don't need to treat bug 1527213 (and some other things) as blockers.
There's still just one blocking issue for (A) in a strange talos sessionstore regression. In order to make it easier and faster to investigate it, I'll land this behind a pref (turned off), so it's just a matter of toggling a pref instead of recompiling. And we'll track turning the pref to true in a separate bug.
Updated•6 years ago
|
Assignee | ||
Comment 40•6 years ago
|
||
So we finished investigating the sessionstore regression. Turns out, what that test measures is a delta of time between two events: when the first SessionRestore module is loaded (SessionStartup.jsm), until the end of session restoration.
With this work, both measurements shift back (happens earlier), so there's actually an improvement in time from process creation until session restore finishes. However, the first measurements shifts back more, so the delta is increased and that gets reported as a regression.
We filed bug 1531520 to improve this talos test so that it's measuring something better. With that in mind, I'm waiting for one final try run and will land these patches with the pref toggled on.
I should note that the hidden window will still be forced to load after first paint (by the second patch in this queue), because there's remaining work to do there to remove it. This will be tracked by bug 1531854.
======
Here are the numbers, for anyone who is interested. Each measurements are from 10 profiled runs on talos.
(std dev for all of them were pretty much stable):
==== talos sessionrestore =====
Base (these patches, preffed off)
Linux: Windows:
646.6ms 662.6ms
Lazy window (these patches, preffed on)
Linux: Windows:
647.0ms 664.9ms
(+0.06%) (+0.34%)
No hidden window (patches from follow up 1531854)
Linux: Windows:
633.4ms 637.3ms
(-2.04%) (-3.81%)
==== talos sessionrestore_no_auto_restore =====
Base (these patches, preffed off)
Linux: Windows:
551.9ms 509.3ms
Lazy window (these patches, preffed on)
Linux: Windows:
535.3ms 512.7ms
(-3.259%) (+0.668%)
No hidden window (patches from follow up 1531854)
Linux: Windows:
535.8ms 485.8ms
(-2.92%) (-4.61%)
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 41•6 years ago
|
||
Rebased. Try looks good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=94715269fd35125ea67d0821a92aa452a191c04e
Comment 42•6 years ago
|
||
Comment 43•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e254496ff95b
https://hg.mozilla.org/mozilla-central/rev/96a507c818e2
https://hg.mozilla.org/mozilla-central/rev/9203871a5c6f
https://hg.mozilla.org/mozilla-central/rev/69d0378e0c09
https://hg.mozilla.org/mozilla-central/rev/3b64368cff52
https://hg.mozilla.org/mozilla-central/rev/eed600ceb606
https://hg.mozilla.org/mozilla-central/rev/9d3805d77b99
https://hg.mozilla.org/mozilla-central/rev/07ef335770a8
https://hg.mozilla.org/mozilla-central/rev/e253b264e7bd
https://hg.mozilla.org/mozilla-central/rev/fd94066a1d76
https://hg.mozilla.org/mozilla-central/rev/845e1d0b2402
https://hg.mozilla.org/mozilla-central/rev/66cffb171024
https://hg.mozilla.org/mozilla-central/rev/f976c2d4cebb
https://hg.mozilla.org/mozilla-central/rev/443087a359f9
https://hg.mozilla.org/mozilla-central/rev/92b45080d080
https://hg.mozilla.org/mozilla-central/rev/54c0b12443ed
Comment 44•6 years ago
|
||
This was backed out from central for causing bug 1532054. Resetting the flags.
https://hg.mozilla.org/mozilla-central/rev/bf3cbcc825276823afba2778333cf62cfa75039c
Updated•6 years ago
|
Assignee | ||
Comment 45•6 years ago
|
||
The cause for the content-process crash that got this backed out was because, before this patch, there was no code in the content process that triggered the creation of the hidden window (since it was only ever created from XRE_mainRun).
So when WindowsUIUtils::UpdateTabletModeState() ran in the content process, it tried to get the hidden window and just failed silently [1]. With these patches, the getter code itself would try to create it, and since it's not supposed to run in the content process at all, it crashes.
The reason this was not caught in tests was because that code is only triggered by a site running a "pointer" or "any-pointer" media query. Although it was surprising that there are apparently no tests at all testing this media query :O. And the returned value is broken for Win10 machines in Tablet Mode. (I'll file a separate bug for that)
Updated•6 years ago
|
Comment 46•6 years ago
|
||
Bug 1532358 tracks improving the test coverage for these pseudo-classes to include the widget codepath. We do in fact have tests for these in content processes, but they use prefs to simulate hardware and hence don't quite test what actually happens in the wild...
Comment 47•6 years ago
|
||
Comment 48•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/200e4a37af47
https://hg.mozilla.org/mozilla-central/rev/1f136a1cafc3
https://hg.mozilla.org/mozilla-central/rev/3c2bc3b312f3
https://hg.mozilla.org/mozilla-central/rev/3606e7bc5406
https://hg.mozilla.org/mozilla-central/rev/3a2cf44afaa3
https://hg.mozilla.org/mozilla-central/rev/8e41627afd1d
https://hg.mozilla.org/mozilla-central/rev/fd1095cf21af
https://hg.mozilla.org/mozilla-central/rev/2cc8de9e4c12
https://hg.mozilla.org/mozilla-central/rev/e4ff7ce96248
https://hg.mozilla.org/mozilla-central/rev/51a46315f660
https://hg.mozilla.org/mozilla-central/rev/38db33426dd4
https://hg.mozilla.org/mozilla-central/rev/52c87e58dff3
https://hg.mozilla.org/mozilla-central/rev/1960442645ea
https://hg.mozilla.org/mozilla-central/rev/5f4cebc62cbd
https://hg.mozilla.org/mozilla-central/rev/cd731fe8a50f
https://hg.mozilla.org/mozilla-central/rev/6013e1f3b648
Comment 49•6 years ago
|
||
Comment 50•6 years ago
|
||
Perf improvement noticed, thanks to push from comment 47.
== Change summary for alert #19944 (as of Mon, 18 Mar 2019 06:33:07 GMT) ==
Improvements:
3% ts_paint windows10-64-pgo-qr opt e10s stylo 326.62 -> 318.15
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=19944
Updated•3 years ago
|
Description
•