Fast string construction

JavaScript performance comparison

Test case created by David

Info

@meodai joining arrays to strings is ALWAYS much slower cc @backflip

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Array
var i, res = [];
for (i = 0; i < 100000; ++i)
   res.push("something quite long something quite long ");
return res.join("");
pending…
String
var i, res = "";
for (i = 0; i < 100000; ++i)
   res += "something quite long something quite long ";
return res;
pending…

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

Compare results of other browsers

0 comments

Add a comment