String concat (v6)

Revision 6 of this benchmark created on


Setup

var i = 0,
      length = 1000,
      string = '',
      strings = [];
    for (var i = 0; i < length; i++) {
      strings.push(Math.random());
    }

Test runner

Ready to run.

Testing in
TestOps/sec
+
for (; i < length; i++) {
  string = string + strings[i];
}
ready
+=
for (; i < length; i++) {
  string += strings[i];
}
ready
String.prototype.concat
for (; i < length; i++) {
  string.concat(strings[i]);
}
ready
Array.prototype.join
string = strings.join('');
ready

Revisions

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