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:
  • removelast

     
    var node = document.getElementById('container');
    while(node.hasChildNodes()) node.removeChild(node.lastChild);
  • 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
    removelast
    removeChild

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Chrome OS 14541.0.0
View result in a separate tab
Test name Executions per second
removelast 3179362.2 Ops/sec
removeChild 3134290.0 Ops/sec