Replace vs Split-Join

Benchmark created on


Setup

str = "123,4567890";

Test runner

Ready to run.

Testing in
TestOps/sec
Split-Join
var res = str.split(",").join(".");
ready
Replace
var res = str.replace(",", ".");
ready

Revisions

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