join/concat (v19)

Revision 19 of this benchmark created by Tilo on


Preparation HTML

<script>
  var count = 500;
  var res;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
concat
res = '';
for (var i = count; i--;) {
 res += 'some more text goes here...';
}
ready
join
res = [];
for (var i = count; i--;) {
 res.push('some more text goes here...');
}
res = res.join('');
ready
join at index
res = [];
for (var i = count; i--;) {
 res[count - i] = 'some more text goes here...';
}
res = res.join('');
ready
join using property lookup
res = [];
for (var i = count; i--;) {
 res[res.length] = 'some more text goes here...';
}
res = res.join('');
ready

Revisions

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