HTML Preparation code:
AخA
 
1
<select id="container"></select>
Script Preparation code:
x
 
var node = document.getElementById('container');
for(var i = 0; i < 3; i++) {
  var option = document.createElement('option');
  option.value = "Some text"
  node.appendChild(option);
}
Tests:
  • innerHTML

     
    var node = document.getElementById('container');
    node.innerHTML = '';
  • removeChild

     
    var node = document.getElementById('container');
    while(node.firstChild) node.removeChild(node.firstChild)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    innerHTML
    removeChild

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
Chrome 61 on Mac OS X 10.12.6
View result in a separate tab
Test name Executions per second
innerHTML 154615.9 Ops/sec
removeChild 1109115.4 Ops/sec