join_vs_concatenation_in_forloop

JavaScript performance comparison

Test case created by ugamas

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Test 1
var ls = [];
for (var i =0; i < 1000; i++){
   ls.push('cadena de prueba' + i);
}
var s = ls.join();
pending…
Test 2
var s = '';
for (var i =0; i < 1000; i++){
   s += 'cadena de prueba' + i;
}
pending…
Test 3
var ls = Array(1000);
for (var i =0; i < 1000; i++){
   ls[i] = 'cadena de prueba' + i;
}
var s = ls.join();
pending…
Test 4
var s = '';
for (var i =0; i < 1000; i++){
   s = s + 'cadena de prueba' + i;
}
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