Replace All vs Split/Join (v39)

Revision 39 of this benchmark created on


Setup

str = '';
    for (var i = 0; i < 100; i++)
      str += "Test abc test test abc test...";

Test runner

Ready to run.

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

Revisions

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