Closed
Bug 1348761
Opened 8 years ago
Closed 8 years ago
Console hangs the browser when attempting to view a printed object
Categories
(DevTools :: Console, defect, P2)
DevTools
Console
Tracking
(firefox55 fixed)
RESOLVED
FIXED
Firefox 55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: jujjyl, Assigned: ochameau)
References
Details
Attachments
(1 file)
STR:
1. Visit http://mzl.la/webassemblydemo
2. After the page loads, open Console devtool and type in "Module" and press enter.
3. The Module object gets printed to console. Click on the word "Module" to attempt to view that object in the console's "object explorer" view.
Observed:
The browser tab hangs. Tested to reproduce on FF 52 stable on OS Xand current FF Nightly on Windows 10.
Comment 1•8 years ago
|
||
Obviously we shouldn't be hanging, but note that there's work upcoming to drop the variables view in favor of expanding the object inline (Bug 1308566).
We'll need to test this page with the new expansion ui and make sure that it doesn't hang there either. I did a quick test in the new Debugger (which is using the same upcoming expansion ui) by pausing and then setting 'Module' as a Watch Expression and attempting to expand, and it seems to have a similar problem. I filed https://github.com/devtools-html/debugger.html/issues/2671 for this.
Depends on: 1308566
Priority: -- → P2
Assignee | ||
Comment 2•8 years ago
|
||
Here is a profile:
https://perfht.ml/2pHcwGK
Most of the time is spent in grip function:
http://searchfox.org/mozilla-central/source/devtools/server/actors/object.js#79-143
Then about 70% of that time is spent in:
g.ownPropertyLength = this.obj.getOwnPropertyNames().length;
Which is weird as it seems to be fast if you call Object.getOwnPropertyNames(Module).length.
May be the Debugger API getOwnPropertyNames is slower??
The rest of the time, a bit less than 30% is spent in TypedArray:
http://searchfox.org/mozilla-central/source/devtools/server/actors/object.js#1472-1504
Itself spending most of its time on Cu.cloneInto.
Assignee | ||
Comment 3•8 years ago
|
||
Note that it is easier to test against:
http://www.hellorust.com/emscripten/sha1/
which doesn't introduce massive computation and slow down the profiler.
Assignee | ||
Comment 4•8 years ago
|
||
Oh, it looks like it isn't against Module object itself, but Module.HEAP* attributes which are big typed array.
We end up retrieving grips for all attributes of Module, this is what takes time
Object.getOwnPropertyNames(Module.HEAP8).length = 16777216
And takes more than a second to compute.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → poirot.alex
Comment 6•8 years ago
|
||
mozreview-review |
Comment on attachment 8860114 [details]
Bug 1348761 - Fix object inspection performances against objects with large Typed Arrays.
https://reviewboard.mozilla.org/r/132128/#review134984
Great find - this is much better! I think this will also fix https://github.com/devtools-html/debugger.html/issues/2671
Attachment #8860114 -
Flags: review?(bgrinstead) → review+
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/934221c412fc
Fix object inspection performances against objects with large Typed Arrays. r=bgrins
Comment 8•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•