Replace All vs Split/Join (v21)

Revision 21 of this benchmark created on


Setup

str = "Test abc test test abc test..."

Test runner

Ready to run.

Testing in
TestOps/sec
split & join
str.split("abc").join("");
ready
replace
while (str.indexOf("abc") != -1) {
str.replace("abc", "");
}
ready

Revisions

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