Comment #2 on issue 1662 by [email protected]: Excessive overhead of
String.replace(/a/g,'b')
http://code.google.com/p/v8/issues/detail?id=1662
Here it is:
[C++]:
ticks total nonlib name
3745 42.9% 42.9%
v8::internal::RegExpImpl::AtomExec(v8::internal::Handle<v8::internal::JSRegExp>,
v8::internal::Handle<v8::internal::String>, int,
v8::internal::Handle<v8::internal::JSArray>)
880 10.1% 10.1%
v8::internal::CompiledReplacement::Apply(v8::internal::ReplacementStringBuilder*,
int, int, v8::internal::Handle<v8::internal::JSArray>)
The test program produces:
$ ./d8 test-d8.js
started: String.replace performance test
1mln char array composed in 34ms
array joined in 5ms
1mln symbol string: all symbols replaced in 95ms
too smart optimizations excluded 1000000 1000000 1000000
$ ./d8.32 test-d8.js
started: String.replace performance test
1mln char array composed in 24ms
array joined in 112ms
1mln symbol string: all symbols replaced in 92ms
too smart optimizations excluded 1000000 1000000 1000000
(d8 is 64 bit, d8.32 is 32)
v8 ChangeLog of my version starts with "2011-08-22: Version 3.5.7"
Attachments:
v8.log.gz 60.3 KB
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev