jQuery vs dojo vs mootools - Dom

JavaScript performance comparison

Revision 101 of this test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8/dojo/dojo.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script>
require(['dojo/query!css3', 'dojo/dom'], function(query, dom) {
  dQuery = query;
  dDom = dom;
});

mQuery = $$;
</script>
<div id="container">
  <div class="content">
    <p></p>
  </div>
</div>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Dojo - Class
var d1 = dQuery(".content");
pending…
jQuery - Class
var j1 = jQuery('.content');
pending…
Mootools - Class
var m1 = mQuery('.content');
pending…
jQuery inside
var j2 = jQuery('.content p');
pending…
Mootools inside
var m2 = mQuery('.content p');
pending…
Dojo inside
var d2 = dQuery(".content p");
pending…
jQuery inside find
var j3 = jQuery('.content').find('p');
pending…
Dojo - ID
var d4 = dQuery("#container");
pending…
jQuery - ID
var j4 = jQuery("#container");
pending…
Mootools - ID
var m4 = document.id("container");
pending…
Dojo inside - ID
var d5 = dQuery("p", "container");
pending…
jQuery inside - ID
var j5 = jQuery("p", "#container");
pending…
Mootools inside - ID
var m5 = document.id("container").getElement("p");
pending…
Native - ID
var n1 = document.getElementById('container')
pending…
Native - Class
var n2 = document.getElementsByClassName('content')
pending…
Native inside - ID
var n3 = document.getElementById('container').getElementsByTagName('p')
pending…
Dojo Dom - ID
var dd1 = dDom.byId('container')
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. Here’s a list of current revisions for this page:

0 comments

Add a comment