split/join vs regex replace (v18)

Revision 18 of this benchmark created on


Preparation HTML

<script>
  var str = 'charlie alpha foxtrot beta gamma delta omega iota kappa lambda mu nu xi omicron theta eta zeta',
      delim = ', ';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
split/join
str.split(' ').join(delim)
ready
regex replace
str.replace(/ /g, delim)
ready

Revisions

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