Open Bug 1320786 Opened 4 years ago Updated 3 years ago
[meta] Improve devtools load time by looking at profiler results against the tools
Looking at the results of the profiler against opening a toolbox, it looks like noone really looked at it, or not recently. The profiler reports many low hanging fruits. The topmost slow step is gcli buttons, which takes 20 to 40% of the toolbox startup time, I filled bug 1320149 to address that. There is also the inspector loading developer-toolbar.js on startup, which is only needed on edge case user interaction (taking screenshot), filled bug 1320703. Lazy load of loader globals is broken. We currently execute lazygetter from builtin-modules everything we access such magic global (It is especially visible on CSS global). Lazy load of loader pseudo modules is also broken, we end up also executing the lazygetter evertime we call require(pseudomodule). And there is a bunch of other things being reported, that are mysterious and would need some more thoughts. I'm attaching a profile sample anyone can open in the performance panel. There is no need to open the browser toolbox, you can just use a perfomance panel from a tab. The JS Call tree is the most useful panel. When you invert the call tree you get the very final methods being slow but that's often too narrowed down. So do not hesitate to disable that. You then need to hit Right arrow key a lot to do down the call tree but it pretty quickly highlight the high level hotspots. Not that this profile has a patch to strip gcli which by itsel introduce a lot of noise! The toolbox opens between 3.5s and near the blue dot, around 10s.
Depends on: 1320149
Thanks for filing. Marking this one as a meta since it looks like the work is breaking out into other bugs
Priority: -- → P2
Summary: Improve devtools load time by looking at profiler results against the tools → [meta] Improve devtools load time by looking at profiler results against the tools
Here is a profile of clicking "Tools -> Web Developer -> Toogle Tools" on the quantum reference hardware: https://perfht.ml/2pC5ZM8 where it takes 2.8s to open and load the devtools panel (for comparison, the warm startup time of the browser was about 1.6s).
As mentioned on IRC, here's the devtools toolbar opening profile with the debugger opening by default, which took a noticeable ~2s on my modern Mac (shows a lot of time is spent on Webpack and require()). https://perfht.ml/2qXoD68
You need to log in before you can comment on or make changes to this bug.