cloneNode vs createElement Performance

JavaScript performance comparison

Revision 18 of this test case created by

Preparation code

<script>
  var a = document.createElement("a");
</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
clone a
var aClone = a.cloneNode(false);
aClone.href = "http://google.com/foo/bar?question=mark&me=notmark#hash"
var b = aClone.hash
var c = aClone.search
pending…
create a
var aa = document.createElement("a");
aa.href = "http://google.com/foo/bar?question=mark&me=notmark#hash"
var b = aa.hash
var c = aa.search
pending…
use same a
a.href = "http://google.com/foo/bar?question=mark&me=notmark#hash"
var b = a.hash
var c = a.search
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