Split and join vs replace vs replaceAll

Benchmark created on


Setup

const url = "https://one.two?three='something'&four='something_else'";

Test runner

Ready to run.

Testing in
TestOps/sec
Split and Join
url.split("'").join("'");
ready
Replace All
url.replaceAll("'", "'");
ready
Replace Regex
url.replace(/'/g, "'");
ready

Revisions

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