replaceAll vs. split

Benchmark created on


Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
replaceAll + trim
"BusinessArea".replaceAll(/([A-Z])/g, ' $1').trim()
ready
split + join
"BusinessArea".split(/(?=[A-Z])/).join(" ")
ready

Revisions

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