concat/join-with-push/join-without-push (v106)

Revision 106 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var longArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 40, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 60, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 70, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 90, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100,0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 40, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 60, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 70, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 90, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100,0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 40, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 60, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 70, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 0, 1, 2,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 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 40, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 60, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 70, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 90, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100,0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 40, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 60, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 70, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 90, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100];
  var shortArray = [0, 1, 2, 3, 4];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
concat(long array)
for (var res = '', i = 0; i < longArray.length; i++) {
 res += longArray[i];
}
ready
join-with-exist-array(long array)
var res = longArray.join('');
 
ready
concat(short array)
for (var res = '', i = 0; i < shortArray.length; i++) {
 res += shortArray[i] + ' ';
}
ready
join-with-exist-array(short array)
var res = shortArray.join(' ');
 
ready

Revisions

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