cloneNode vs createElement (v10)

Revision 10 of this benchmark created by sandeep on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var tmp = document.createElement('div');
    tmp.style.backgroundColor = "#234567";
    tmp.style.position = "absolute";
    tmp.style.zIndex = 3;
    tmp.style.borderWidth = "1px";
    tmp.style.borderColor = "red";

Test runner

Ready to run.

Testing in
TestOps/sec
JS Clone
var a = tmp.cloneNode();
ready
JS Create
var a = document.createElement('div');

a.style.backgroundColor = "#234567";
a.style.position = "absolute";
a.style.zIndex = 3;
a.style.borderWidth = "1px";
a.style.borderColor = "red";
ready

Revisions

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

  • Revision 1: published by Daryl Ginn on
  • Revision 2: published by The Able Few on
  • Revision 3: published by Rhys Brett-Bowen on
  • Revision 4: published by Rhys Brett-Bowen on
  • Revision 10: published by sandeep on