Closed Bug 929507 Opened 11 years ago Closed 10 years ago

Yarr is not compiling jQuery selector parsing regexp

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jandem, Unassigned)

References

Details

The domJQueryContentFilters test in bug 922063 spends a lot of time running in the Yarr interpreter. For the reduced testcase below I get the following numbers:

d8:   5 ms
SM: 101 ms

var re = /(^(?:.|\r|\n)*?)#((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?![^\[]*\])(?![^\(]*\))/;
function f() {
    var t = new Date;
    for (var i=0; i<36000; i++)
	res = re.exec("p:contains('Sega')");
    print(new Date - t);
    return res;
}
f();
No longer blocks: 922063
Blocks: 922063
Blocks: 922048
The problem here is that Yarr can't compile nested parenthesized groups. See https://bugs.webkit.org/show_bug.cgi?id=42264 for details, but basically, Yarr allocates the stack for a compiled regexp in advance and can't deal with dynamically-sized stacks.

This is a fundamental issue that we're very unlikely to be able to solve on our side. :(
This bug is no longer relevant because bug 976446 replaced YARR with irregexp.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.