Closed Bug 617136 Opened 14 years ago Closed 13 years ago

Investigate RegExp slowness on Peacekeeper snippet

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cdleary, Assigned: cdleary)

References

(Blocks 1 open bug)

Details

Jandem pointed out this example, derived from Dromaeo.

function f(ua) {
    var x = 0;
    var t0 = new Date;
    for(var i=0; i<10000000; i++) {
	//var ua1 = ua + i;
	if (/Windows/.exec(ua)) 
	    x++;
    }
    alert(new Date - t0);
    return x;
}
f("Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)");

<jandem> bz: when i change exec to test... FF4: 3600 ms, latest webkit nightly: 2200 ms, opera 980 ms...
Summary: Investigate RegExp slowness → Investigate RegExp slowness on Dromaeo snippet
Blocks: 551624
Assignee: general → cdleary
QA Contact: cdleary → general
Not Dromaeo but Peacekeeper. stringDetectBrowser test (see http://hg.mozilla.org/users/mpalmgren_mozilla.com/peacekeeper) But I think it's a general regexp problem, so it affects Dromaeo too.
Blocks: peacekeeper
Summary: Investigate RegExp slowness on Dromaeo snippet → Investigate RegExp slowness on Peacekeeper snippet
Isn't this one fixed now?
Seems to be in the sense that exec() and test() do equally fast (or slowly?) on the testcase from comment 0 in latest nightly.

We're faster than Chrome there, but slower than Opera....
That sounds fixed to me (by Brian's bug to elide object creation in the regexp literal exec case). Reopen if there are objections.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.