array join vs string connect (v46)

Revision 46 of this benchmark created on


Preparation HTML

<script>
  var blah = "Test Test";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
array join
var tmp = [];
for (i = 0; i < 100; i++) {
  tmp.push(blah + "This is a test of a really long string to see if there is any difference based on the size of data being concatenated vs pushed into an array.  Hopefully, concatenate wins because I really don't like the look of the array push, seems misleading since the output itself is going to be a string (always) and never has anything to do with an array." + blah + "This is a test of a really long string to see if there is any difference based on the size of data being concatenated vs pushed into an array.  Hopefully, concatenate wins because I really don't like the look of the array push, seems misleading since the output itself is going to be a string (always) and never has anything to do with an array. " + blah);
}
var output = tmp.join('');
ready
string connect
var output = '';
for (i = 0; i < 100; i++) {
  output += blah + "This is a test of a really long string to see if there is any difference based on the size of data being concatenated vs pushed into an array.  Hopefully, concatenate wins because I really don't like the look of the array push, seems misleading since the output itself is going to be a string (always) and never has anything to do with an array." + blah + "This is a test of a really long string to see if there is any difference based on the size of data being concatenated vs pushed into an array.  Hopefully, concatenate wins because I really don't like the look of the array push, seems misleading since the output itself is going to be a string (always) and never has anything to do with an array. " + blah;
}
ready

Revisions

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