Doing SavedStack for CallbackObjects is expensive that youtube take 500ms+ on PCToLineNumber().
Categories
(Core :: JavaScript Engine, enhancement)
Tracking
()
People
(Reporter: sinker, Unassigned)
References
Details
YouTube home page spends a lot of time on calling CustomElementRegistry.define(), the hot spot is on the function PCToLineNumber() taking more than 500ms of 3s in my case. CustomElementRegistry.define() will create a CallbackObject. And, we have async stack to help debugging and error handling. It requires saving frames (SaveFrame) including the information of line numbers.
I have tried to remove the line calling PCTOLineNumber() and use a fixed value 1, and it shorten the loading time of youtube 500ms~800ms.
The frame information here is only used during debugging or profiling (I assume). So, is it worth 500ms in the youtube case?
I think we may skip it at all or doing it lazily.
Reporter | ||
Comment 1•21 days ago
|
||
According to the discussion on Matrix, this is obviously caused by devtools. I triggered profiling from devtools and enabled this call patch. Starting from "Start Recording" button of Firefox Profiler, this overhead disappear.
Comment 2•20 days ago
|
||
I'm going to resolve this as invalid, but I did open https://github.com/firefox-devtools/profiler/issues/5383 to see if there are any UX affordances we could make more clear.
Updated•20 days ago
|
Description
•