Ultimate string concatenation tests (v4)

Revision 4 of this benchmark created on


Description

Comparing much larger iterations

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js"></script>
<script>
dojo.require("dojox.string.Builder");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Push and join
var array = [];
for (var i = 0; i < 100000; i++) {
 array.push(array.length);
}

var str = array.join("");
ready
String +=
var str = "";
for (var i = 0; i < 100000; i++) {
 str += str.length;
}
ready

Revisions

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