cloneNode vs createElement Performance (v16)

Revision 16 of this benchmark created on


Description

check speeds with different elements

Preparation HTML

<script>
  var img = document.createElement("img");
  img.src = "http://www.google.com/intl/en_com/images/srpr/logo2w.png";
  
  var div = document.createElement("div");
  div.className = "myclass1 myclass2";
  
  var input = document.createElement("input");
  input.type = "checkbox";
  input.className = "myinputclass";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
clone div
var divClone = div.cloneNode(false);
ready
create div
var div = document.createElement("div");
div.className = "myclass1 myclass2";
 
ready

Revisions

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