Closed
Bug 289669
Opened 20 years ago
Closed 15 years ago
RegExp Object is extremely slow with String.replace
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bugs, Unassigned)
References
()
Details
Attachments
(2 files)
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050402 Firefox/1.0+
I do not know if it is the RegExp implementation or the String.replace method
implementation but the URL given executes in 61 msec on IE, ~500 msec on
Mozilla/Firefox. Given the current speed of the processors I think mozilla
should break well down the 60 msec barrier. 500 msec is just plain unacceptable
as you may also agree with.
Reproducible: Always
Steps to Reproduce:
1.run the code
2.
3.
Actual Results:
It should be blazingly fast
Expected Results:
Runs like an old i386DX on a 1.5ghz pentium 4.
For real life success, this needs to be sped up.
Reporter | ||
Comment 1•20 years ago
|
||
Correction on the given URL, IE runtime speed is between 16-31 msecs. Mozilla
runtime is between 484-500 msecs.
ouch!
;)
Comment 2•20 years ago
|
||
confirmed. we have O(N^2) behavior while IE has O(N)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 3•20 years ago
|
||
O(N) ;), almost NP Complete aye?
Comment 4•20 years ago
|
||
The testcase seems to be down. Can someone attach it to this bug? Or is this
just a bug about String.replace being slow?
Comment 5•20 years ago
|
||
Comment 6•20 years ago
|
||
Comment 7•20 years ago
|
||
Checking in regress-289669.js;
/cvsroot/mozilla/js/tests/ecma_3/RegExp/regress-289669.js,v <-- regress-289669.js
initial revision: 1.1
done
Flags: testcase+
Comment 8•19 years ago
|
||
we are linear on the trunk now on all platforms but still much slower than IE (almost 30 times slower on limit 9000).
Comment 9•19 years ago
|
||
still O(N^2) for windows shell from 20060405, but not browser. Maybe the windows realloc....
Comment 10•15 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100503 Firefox/3.6.4
Using regexp.html I got 16-19 ms, much lower than the original 500 ms.
With Chrome 5, I got 6-9 ms.
Comment 11•15 years ago
|
||
On both 1.9.2.5pre and 1.9.3a5pre I get 9-11 ms. Not tried Chrome 5 on linux.
Comment 12•15 years ago
|
||
This is about as fast as Chrome now (4-6), probably fixed by YARR. Marking fixed.
You need to log in
before you can comment on or make changes to this bug.
Description
•