Pasting big JSON into Console freezes content process
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox69 fixed)
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: Harald, Assigned: nchevobbe)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
What were you doing?
- Open https://data.cityofnewyork.us/api/views/kku6-nxdu/rows.json?accessType=DOWNLOAD
- Paste raw JSON into Console
- Close DevTools
What happened?
Was able to close DevTools but the tab stayed unresponsive, it is now frozen for 5min and doesn't seem to recover.
Anything else we should know?
Profile: http://bit.ly/2W5cdo3
The content process is stuck in
analyzeInputString
js::RunScript
exports.makeInfallible/<
js::RunScript
autocomplete
bound
onPacket
receiveMessage
js::RunScript
MessageListener.receiveMessage
message manager handler
PBrowser::Msg_AsyncMessage
XRE_InitChildProcess
(root)
Assignee | ||
Comment 1•4 years ago
|
||
Okay, so I can see where this takes time. A first step might be to not try to autocomplete if the input is > to a given number of chars?
Reporter | ||
Comment 2•4 years ago
|
||
A first step might be to not try to autocomplete if the input is > to a given number of chars?
I thought about that too, makes for a good safeguard.
How sure are we that the issue here grows with character count vs hitting some recursive issue?
Assignee | ||
Comment 3•4 years ago
|
||
How sure are we that the issue here grows with character count vs hitting some recursive issue?
Yeah, the analyzeInputString
function is one big for loop and doesn't use recursion.
From the profile, it looks like all the Array.from
(and then Array.slice
and Array.join
) are responsible of the massive slowdown.
I'm trying to fix this by using something else.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
It can happen that the string we receive is quite large
and as a result takes a long time to analyze, freezing
the process.
This patch simply tracks for how long the for loop is running,
and bail out if it's greater than a given time (set to 2500 ms
for now).
This is mostly a safeguard, a future patch should try to improve
the performance of the function itself.
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0a7fc2e413ad Track JsPropertyProvider's analyzeInput string and bail if it's taking too long. r=Honza.
Comment 6•4 years ago
|
||
bugherder |
Description
•