Append test

Benchmark created on


Preparation HTML

<select id="o1"></select>

Teardown



            document.getElementById('o1').innerHTML = '';
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
Options string append
var combo = document.getElementById('o1');
var htmlStr = '';
for (var i=0;i<10; i++) {
    htmlStr += "<option value=\"" + i + "\">" + i + "</option>";
}
combo.innerHTML = htmlStr;
ready
Options DOM append
var combo = document.getElementById('o1');
for (var i=0;i<10; i++) {
    combo.innerHTML += "<option value=\"" + i + "\">" + i + "</option>";
}
    
ready

Revisions

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