clear-element

JavaScript performance comparison

Test case created by Renat

Preparation code

<div id="mydiv">

</div>

 
<script>
Benchmark.prototype.setup = function() {
    div = document.getElementById("mydiv")
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
last
div.innerHTML = "<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>"
var c;
while(c = div.lastChild) {
  div.removeChild(c)
}
pending…
first
div.innerHTML = "<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>"
var c;
while(c = div.firstChild) {
  div.removeChild(c)
}
pending…

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

Compare results of other browsers

0 comments

Add a comment