Closed Bug 1577273 Opened 5 years ago Closed 5 years ago

Inactive debugger slows down js that uses data-urls

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: tcampbell, Assigned: bhackett1024)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

URL: https://www.datascience.com/blog/stock-price-time-series-arima
(There are several perf bugs going on there, but this bug is about the debugger source URL atomization)

The RememberSourceURL method added recently is being triggered for each function clone under js::CloneFunctionAndScript. When the page uses data URLs this can lead several seconds spent atomizing.

Related to this is the strlen call for RememberSourceURL can be quite slow just to determine string is too large. In Bug 1577161 I'll introduce a js_strnlen which might also be useful here.

See Also: → 1577161

The ScriptSource::filename is now a SharedImmutableString under the hood so we could use that instead of atomizing filenames immediately. Ideally we'd also add an onNewScriptSource hook to debugger.

Brian, can you take a look at this?

Flags: needinfo?(bhackett1024)
See Also: → 1576999

Looking at this more, I don't think this is urgent for FF70. In the degenerate example, the impact is much smaller than several of the other factors there.

Actually in the degenerate case it contributes several seconds to page load. I'm unclear if it comes up on other websites or not.

This might need to wait for bug 1577161 to get js_strnlen, but just using strnlen compiles locally for me at least. I can look into improving the data structure here to avoid atomizing the filenames, but this small fix should take care of the O(N) behavior when dealing with huge filenames.

Flags: needinfo?(bhackett1024)
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e61f7df8ebf2
Use strnlen to test if source URLs are too long, r=tcampbell.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → bhackett1024
Has Regression Range: --- → yes
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: