Bug 1546877 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

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](https://bugzilla.mozilla.org/static/v20190418.1/js/lib/prism.js) (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?
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](https://bugzilla.mozilla.org/static/v20190418.1/js/lib/prism.js) (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](https://prismjs.com/extending.html#api), 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?

Back to Bug 1546877 Comment 3