cloneNode vs createElement Performance

JavaScript performance comparison

Revision 81 of this test case created by Bartosz Majdan

Preparation code

<script>
var tab = []
  for(var i = 0; i < 100; i++){
tab.push(i);
}
</script>
    

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
create div
var tab2 = []
for(i = 4; i < tab.length; i++){
tab2.push(i);
}
pending…
clone div
var tab2 = tab.slice(4, tab.length - 1);
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