Comment #11 on issue 1662 by [email protected]: Excessive overhead of
String.replace(/a/g,'b')
http://code.google.com/p/v8/issues/detail?id=1662
Twice as fast now, thanks (but still 10 times slower than it could be :)
$ ./d8 ./test-d8.js
started: String.replace performance test
1mln char array composed in 37ms
array joined in 3ms
1mln symbol string: all symbols replaced in 38ms
too smart optimizations excluded 1000000 1000000 1000000
[C++]:
ticks total nonlib name
731 25.3% 25.3% void
v8::internal::String::WriteToFlat<char>(v8::internal::String*, char*, int,
int)
465 16.1% 16.1% v8::internal::MaybeObject*
v8::internal::StringReplaceStringWithString<v8::internal::SeqAsciiString>(v8::internal::Isolate*,
v8::internal::Handle<v8::internal::String>,
v8::internal::Handle<v8::internal::JSRegExp>,
v8::internal::Handle<v8::internal::String>)
398 13.8% 13.8% void v8::internal::CopyChars<char, char>(char*,
char const*, int)
P.S. sorry for the deleted comment; it was a wrong branch.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev