join/concat (v42)

Revision 42 of this benchmark created by rvignacio on


Description

A simpler check for testing for concat vs join outside of a loop (not building a string in a loop, typical use case would be to use a var in the string).

Edit: Simplified version to test only the creation of a String without appending other variables.

Preparation HTML

<script>
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
concat
var a = 'this' + ' is' + ' a' + ' string' + ' to' + ' test' + ' if' + ' there' + ' is' + ' any' + ' difference' + ' between' + ' concat' + ' and' + ' join';
ready
join
  var barr = ['this', ' is', ' a', ' string', ' to', ' test', ' if', ' there', ' is', ' any', ' difference', ' between', ' concat', ' and', ' join'].join('');
ready

Revisions

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