Comment #12 on issue 1662 by [email protected]: Excessive overhead of String.replace(/a/g,'b')
http://code.google.com/p/v8/issues/detail?id=1662
I suppose you are assuming that string.replace should be as fast as array.join. However, string replace is somewhat more complex than copying array elements into one buffer. Of course the fact that array.join is done in compiled code further speeds it up. For now however there is no strong incentive to invest more time in making non-regexp global string replace any faster because the usage of that is rather limited.
However, V8 accepts contributions. I'll be more than happy to review patches, for example implementing string.replace in compiled code.
-- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
