I hope you are still not tired of reading these! 🙂 If not, time for another quick update about the ongoing performance related work.
There are two important changes that have landed in Nightly. The first one is that Nightly (on Windows 32-bit builds) sends native stacktraces with background hang reports of 128ms or longer now. This change makes it easier to interpret the BHR data because now the Gecko Profiler pseudo stack traces are captured at the same time, rather than seconds apart, as I described two weeks ago. It also gives us a much broader perspective into what happens when Firefox Nightly behaves sluggishly on our user’s machines. The next step is to also split this into hangs that happen when the user is using the browser. And then we will start to triage those in the hopes of more directly improving the responsiveness of the browser. We have been using the current data either to file some new bugs or to corroborate some reported bugs for example where there was a profile attached. Recently at mconley’s suggestion we started to tag bugs with BHR evidence with
[bhr]in the status whiteboard for easier classification. So far there aren’t many filed yet. Currently finding useful bug reports from this data set is fairly difficult and time consuming, and we could certainly use more help in this area.
The other important change that just landed was disabling non-multiprocess compatible add-ons in Nightly. I wrote about the importance of doing this last week. The adverse performance impact of these add-ons heavily skews our performance measurements on Nightly. I know that losing add-ons that you use is no fun (Nightly disabled a few of my own add-ons when I upgraded to the latest version this morning!) but I kindly ask you to please consider not re-enabling these extensions on Nightly. We know that WebExtension based add-ons are the future, and as Nightly users your help in suffering through a bit of a pain through this transition earlier in order to help us better understand where we are in improving the performance of the browser is much appreciated.
There are many great ongoing efforts to improve the performance of the browser in many areas. This week I want to highlight the great work that the front-end team has been doing. One example is the recent effort that Mike Conley, Neil Deakin and Florien Quèze have started to study and improve our startup times. The good news: it’s already working! Here is the graph of the ts_paint Talos showing the time that it takes to paint the initial window after startup starting to show steady improvements in the last 30 days!
Another example is the ongoing work to reduce the impact of synchronous reflows on the performance of the Firefox user interface. And then there is all of the great work under the Photon-Performance umbrella. And not to say anything about the upcoming Photon visual refresh project itself, which is being designed/implemented with performance in mind from scratch. And then there is the “miscellaneous stuff”, like the fact that as of a few days ago, closing tabs should be almost instant in Nightly, or how so far on the Firefox 55 cycle, the 95th percentile window restore 14-day moving median number is about 5 times faster than where we started in the beginning of the cycle:
Special thanks for the hard work of all of the people contributing to the front-end in every way! And now it’s time to acknowledge the work done in the past week. As always, I hope I’m including everyone!
- Doug Thayer added a WebExtension API to nsIProfiler, and is very close to shipping a WebExtension version of the Gecko Profiler Add-on. This will help reduce Add-on SDK noise in captured profiles, and ensures that the Profiler Add-on will be available during and after Firefox 57!
- Mike Conley made it so that we don’t do a potentially expensive IPC round-trip when closing tabs in the common case. This should help make closing tabs faster. He wrote a blog post about it too.
- David Anderson made the compositor on Windows front-load shader loading so that it’s more ready to composite things when the first layer tree gets uploaded.
- Michael Layzell made it so that we can get more native stacks via the Background Hang Reporter! This will greatly enrich the data that Telemetry gathers to let us know when things are slow. He also made sure that the pseudo and native stacks are captured in the same tick.
- David Baron made nsFrame::FinishAndStoreOverflow call nsIFrame::StyleDisplay less, making layout more efficient in certain scenarios.
- Neil Deakin added a way to batch potentially-expensive XUL command updates into a single call, and then made sure our tab switching and menu panel opening code uses it. He also made a reflow far less common when showing tooltips on non-remote content (like the about:newtab page).
- Nicholas Hurley made it so that we speculatively connect to servers when the mousedown event occurs on links to improve perceived performance of page navigation.
- Neerja Pancholi got rid of some redundant calls to nsIFrame::StyleDisplay for a nice layout efficiency win.
- Andrew Swan landed patches to disable add-on shims on Nightly! This will greatly reduce the amount of noise in profiles and Background Hang Reporter data caused by our (well-intentioned, but tragically slow) shimming layer.
- Wei-Cheng Pan added telemetry for input event handling latency.
- Edouard Oger got rid of some expensive Sync code that was running before the first window was painted, and some other Sync code that was loading for every new window resulting in a 3% improvement on the tpaint Talos test on Windows.
- Patrick McManus made sure that we initialize the Windows networking stack off of the main thread on start-up.
- Kris Maglione made a bunch of code that runs in nsBrowserGlue before the first window is shown load lazily instead! This should improve our start-up performance. Talos agrees. Kris also fixed the displaying of remote XUL browser panels in XUL popups. This is a blocker of out-of-process WebExtensions, which is highly desirable for improving the performance of the parent process by reducing the impact of installed add-ons (including our own add-ons perhaps!)
- Kannan Vijayan got rid of patchable GC pre-barriers. Patching these barriers required two mprotects.
- Florian Quèze got rid of some main thread IO on start-up on Windows, which should also boost our start-up performance.
- Gabor Krizsanits enabled the Pre-allocated Process Manager by default, which should improve perceived performance when opening new tabs or windows that would normally allocate a new content process on the fly.
- Kevin Jones fixed a recent regression causing all lazybrowsers to be eagerly instantiated.
- Evelyn Hung improved the years-old heuristics of the spell checker to improve typing responsiveness. These heuristics, besides being old, were actively harmful for performance in e10s.
- Shane Caraveo removed an unnecessary call to the SocialService.getProvider() function during startup.
- Ben Kelly and Boris Zbarsky (a couple of weeks ago) optimized the data structures of the timer thread. Boris noticed the slowness in a profile and realized Ben had patches pending review comments being addressed, and he helped land them.