Closed Bug 1220106 Opened 10 years ago Closed 9 years ago

Slow regexp execution slows down the entire browser

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bbouvier, Unassigned)

Details

Attachments

(1 file)

Attached file highlight.pack.js
Here is a pure JS test case adapted from a real world website. The website is a pastebin like that tries to highlight the text by automatically detecting which language is used. The slow pop up appears in Firefox, and the slow warning in Chromium, so that might be irregexp being just terribly slow. I haven't tried on other browsers, although I'd like to see the results in Safari. Hannes, is there something we can do here?
Breaking in gdb shows that we're mainly spending time in the irregexp::InterpretCode function. Linux perf CLI tool says 45% of time is spent in js::irregexp::InterpretCode<unsigned char>, 20% of time in Load32Aligned(unsigned char const*).
We should figure out why we're running in the interpreter instead of JIT..
Flags: needinfo?(hv1989)
Could it be because of bug 1219337 ?
There is not much we can do here. We hit the "RegExpStack" limit and as a result fall back to the interpreter. This is an issue in irregexp which would probably need a full rewrite of the regexp engine. I'll close this, since there is not much we can do here. This regexp is expected to be slow.
Flags: needinfo?(hv1989)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: