Slow Script warning on bugzilla page when loading preview of large json file
Categories
(bugzilla.mozilla.org :: User Interface, defect)
Tracking
()
People
(Reporter: rowbot, Unassigned)
References
Details
Attachments
(1 file)
It would appear that bugzilla's file preview feature is having a bad time with a large json file in Bug 1263593. Not sure where to file this bug.
Performance profile: https://perfht.ml/2ZwmY5I
STR:
- Go to Bug 1263593 comment 4
Reporter | ||
Comment 1•6 years ago
|
||
Better performance profile: http://bit.ly/2UMzV87
Updated•6 years ago
|
Comment 2•6 years ago
|
||
86% of the time in the profile is in js. -> js for a look.
Comment 3•6 years ago
•
|
||
Of that 86% of the time, 78% is spent in js::irregexp::InterpretCode, handling a regexp in the matchGrammar function in this Prism.js code (which does syntax highlighting).
On my machine, at least, Chrome also crashes. The problem is either a degenerate regex, or an overly large json file.
It looks like prism.js supports async highlighting, which might let us move the highlighting offthread and avoid blocking the main thread. Alternatively, maybe Bugzilla should just skip syntax highlighting on files above a certain size.
Dylan, can this get fixed in Bugzilla's file preview code?
Reporter | ||
Comment 4•6 years ago
|
||
The json file being processes is 1.10MB according to Bugzilla.
Comment 5•6 years ago
|
||
I believe there is a patch in flight to turn off preview on larger files, so this should be fixed in that way soon. We might also do the async highlighting at a later date.
Comment 6•6 years ago
|
||
Based on the Gecko profile link from comment 1, this looks like a BugModal extension & prism.js issue.
Moving to bugzilla.mozilla.org component.
Updated•6 years ago
|
Comment 7•6 years ago
|
||
Seems like Prism’s async highlighting is not working, so I’ll just limit the max text preview size to 50 KB.
Comment 8•6 years ago
|
||
Comment 9•6 years ago
|
||
Merged to master.
Updated•6 years ago
|
Description
•