HTML Preparation code:
AخA
 
1
<div id="container"></div>
Script Preparation code:
x
 
var node = document.getElementById('container');
for(var i = 0; i < 30000; i++) node.appendChild(document.createElement('div'));
Tests:
  • innerHTML

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

     
    var node = document.getElementById('container');
    var i = node.children.length;
    while(i--) node.removeChild(node.firstChild)
  • removeLastChild

     
    var node = document.getElementById('container');
    var i = node.children.length;
    while(i--) node.removeChild(node.lastChild)
  • removeFirstChildNonIndex

     
    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
    removeFirstChild
    removeLastChild
    removeFirstChildNonIndex

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2025 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Chrome 63 on Mac OS X 10.12.6
View result in a separate tab
Test name Executions per second
innerHTML 464028.5 Ops/sec
removeFirstChild 2482166.8 Ops/sec
removeLastChild 2536845.2 Ops/sec
removeFirstChildNonIndex 3048135.0 Ops/sec