regular expressions are VERY slow in firefox, see article and code
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: sergemp, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
118 bytes,
text/html
|
Details |
Comment 1•10 years ago
|
||
Updated•3 years ago
|
Comment 2•1 year ago
|
||
I tried this as a HTML page, and these are the results:
Nightly: https://share.firefox.dev/47MdDKQ (18s without the profiler)
Chrome: https://share.firefox.dev/3XDJJDJ (9s)
Comment 3•1 year ago
|
||
Comment 4•1 year ago
|
||
The difference between us and Chrome here is weird, because to a first approximation the entire profile is spent compiling the regex (in recursive calls to ChoiceNode::FillInBMInfo and TextNode::FillInBMInfo), and that code is in the shared part of the regex engine. So it's not clear why Chrome's performance would differ at all.
(Note that unlike most reports of pathological regex performance, it looks like this one is spending time compiling the regex, not running it. Without looking into it, my best guess is that irregexp may be doing something clever with Boyer-Moore to make a fast matcher, but it takes an unreasonable amount of time to generate that matcher. Otherwise we'd see time spent executing the regex, which seems to be absent from the profile.)
Updated•1 year ago
|
Description
•