Replace All vs Split/Join (v52)

Revision 52 of this benchmark created by rmetzler on


Setup

var str = "Test abc test test abc test...";
    var regex = /abc/g;

Test runner

Ready to run.

Testing in
TestOps/sec
split & join
str.split("abc").join("cde");
ready
replace
str.replace(regex, 'cde');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.