Dom Creation

JavaScript performance comparison

Test case created by Joe

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://zeptojs.com/zepto.min.js"></script>
	<script src="https://raw.github.com/insin/DOMBuilder/master/dist/DOMBuilder.dom.min.js"></script>
<div class="container">
</div>

    

Preparation code output

<div class="container"> </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
createElement
var el = document.createElement("div");
el.classList.add("foo");
el.classList.add("bar");
var parent = document.querySelector(".container");
parent.appendChild(el);
pending…
jQuery
var el = jQuery("<div class='foo bar'>");

var parent = document.querySelector(".container");
parent.appendChild(el[0]);
pending…
zepto
var el = Zepto("<div class='foo bar'>");
var parent = document.querySelector(".container");
parent.appendChild(el[0]);
pending…
className
var el = document.createElement("div");
el.className = "foo bar";
var parent = document.querySelector(".container");
parent.appendChild(el);
pending…
dombuilder
var d = DOMBuilder.dom;
var el = d.DIV({'class': 'foo bar'});
var parent = document.querySelector(".container");
parent.appendChild(el);
pending…
jQuery2
var el = jQuery("<div>", {class: 'foo bar'});
var parent = document.querySelector(".container");
parent.appendChild(el[0]);
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