Browser Diet - DOM Manipulation

JavaScript performance comparison

Revision 19 of this test case created by Łukasz Mleczko

Preparation code

<div id="myList"></div>
    

Preparation code output

<div id="myList"></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
DOM manipulation for
var myListHTML = document.getElementById("myList").innerHTML;

for (var i = 0; i < 100; i++) {
  myListHTML += "<span>" + i + "</span>";
}
pending…
DOM manipulation while
var myListHTML = document.getElementById("myList").innerHTML;
var i = 100;
while(i--){
  myListHTML += "<span>" + i + "</span>";
}
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