Closed Bug 1546877 Opened 6 years ago Closed 6 years ago

Slow Script warning on bugzilla page when loading preview of large json file

Categories

(bugzilla.mozilla.org :: User Interface, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

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:

  1. Go to Bug 1263593 comment 4

Better performance profile: http://bit.ly/2UMzV87

Component: General → Graphics

86% of the time in the profile is in js. -> js for a look.

Component: Graphics → JavaScript Engine

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?

Flags: needinfo?(dylan)

The json file being processes is 1.10MB according to Bugzilla.

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.

Flags: needinfo?(dylan)

Based on the Gecko profile link from comment 1, this looks like a BugModal extension & prism.js issue.
Moving to bugzilla.mozilla.org component.

Component: JavaScript Engine → General
Product: Core → bugzilla.mozilla.org
Version: Trunk → Production
Assignee: nobody → kohei.yoshino
Component: General → User Interface: Modal

Seems like Prism’s async highlighting is not working, so I’ll just limit the max text preview size to 50 KB.

Status: NEW → ASSIGNED

Merged to master.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Assignee: kohei.yoshino → nobody
Component: User Interface: Modal → User Interface
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: