String building

Benchmark created on


Preparation HTML

<div id="result">

</div>

Setup

var append_string = "abc";

Test runner

Ready to run.

Testing in
TestOps/sec
Direct DOM appending
var result = document.getElementById('result').innerHTML;
for(var i = 0; i < 1000; i++) {
 result += append_string;
}
ready
Build and then add to DOM
var result = "";
for(var i = 0; i < 1000; i++) {
 result += append_string;
}
document.getElementById('result').innerHTML = result;
ready

Revisions

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