Closed Bug 1950238 Opened 21 days ago Closed 20 days ago

Doing SavedStack for CallbackObjects is expensive that youtube take 500ms+ on PCToLineNumber().

Categories

(Core :: JavaScript Engine, enhancement)

enhancement

Tracking

()

RESOLVED INVALID

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.

See Also: → 929950

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.

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.

Status: NEW → RESOLVED
Closed: 20 days ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.