DOM.create vs jquery (v19)

Revision 19 of this benchmark created on


Description

Compare performance of the better-dom library and jquery in typical cases

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.js"></script>
<script src="//rawgithub.com/chemerisuk/better-dom/v1.6.0/dist/better-dom.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jquery#create(String)
jQuery("<a>");
ready
jquery#$.parseHTML(String)
jQuery.parseHTML("<a>");
ready
DOM#create(String)
DOM.create("a");
ready
jquery#create(Element)
jQuery(document.createElement("a"));
ready
DOM#create(Element)
DOM.create(document.createElement("a"));
ready
jquery#create(HtmlString)
jQuery("<a id='a1' rel='b2'><span></span><i></i></a>");
ready
jquery#$.parseHTML(HtmlString)
jQuery.parseHTML("<a id='a1' rel='b2'><span></span><i></i></a>");
ready
DOM#create(HtmlString)
DOM.create("<a id='a1' rel='b2'><span></span><i></i></a>");
ready
DOM#create(EmmetString)
DOM.create("a#a1[rel=b2]>span+i");
ready
jquery#create(Options)
jQuery("<a>", {id: "a1", rel: "b2"}).append("<span>", "<i>");
ready
jquery#create(attr)
jQuery("<a>").attr({id: "a1", rel: "b2"}).append("<span>", "<i>");
ready
DOM#create(Options)
DOM.create("a#id=${id}[rel=${rel}]", {id: "a1", rel: "b2"}).append("span", "i")
ready

Revisions

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