HTML Preparation code:
AخA
 
1
<div id="container"></div>
Script Preparation code:
x
 
var node = document.getElementById('container');
for(var i = 0; i < 1000; i++) node.appendChild(document.createElement('div'));
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: 6 years ago)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
Chrome 68 on Windows
View result in a separate tab
Test name Executions per second
innerHTML 1924606.6 Ops/sec
removeChild 2375280.5 Ops/sec