Investigate RegExp slowness on Peacekeeper snippet

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: cdleary, Assigned: cdleary)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

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

Updated

7 years ago
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: 499198
Summary: Investigate RegExp slowness on Dromaeo snippet → Investigate RegExp slowness on Peacekeeper snippet
Isn't this one fixed now?

Comment 3

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.