Node#removeChild

JavaScript performance comparison

Test case created by Mathias Bynens

Preparation code

<div id="container"></div>
      
<script>
Benchmark.prototype.setup = function() {
  var counter = this.count, // `this` refers to the current test
      container = document.getElementById('container');
  
  // add as many child elements as there are test iterations
  while (counter--) {
    container.appendChild(document.createElement('p'));
  }

};
</script>

Preparation code output

<div id="container"></div>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
removeChild
container.removeChild(container.firstChild);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments