HTML Preparation code:
AخA
 
1
<p id="foo">
2
    <span>hello</span>
3
    <div>world</div>
4
</p>
Tests:
  • 1

     
    var node = document.querySelectorAll("#foo");
    for (let i = 0; i < node.length; i++) {
      node[i].innerHTML = '';
    }
  • 2

     
    var node = document.querySelectorAll("#foo");
    for (let i = 0; i < node.length; i++) {
      node[i].parentNode.removeChild(node[i]);
    }
  • 3

     
    var node = document.querySelectorAll("#foo");
    for (let i = 0; i < node.length; i++) {
      node[i].innerHTML = '';
      node[i].parentNode.removeChild(node[i]);
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    1
    2
    3

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
Firefox 56 on Windows
View result in a separate tab
Test name Executions per second
1 583904.6 Ops/sec
2 1079862.6 Ops/sec
3 1075425.6 Ops/sec