Concatenation vs Array Join

JavaScript performance comparison

Revision 24 of this test case created

Preparation code

<script>
  var str, str1, i, j;
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Concatenation
for (i = 0; i < 10000; i++) {
 str += 'abcdefghijklmnop<test></test>';
}
pending…
Array.prototype.join
var tmp = [];
for (j = 0; j < 10000; j++) {
 tmp.push('abcdefghijklmnop<test></test>');

}
str2 = tmp.join('');
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment