jQuery vs dojo vs mootools - Dom

JavaScript performance comparison

Revision 6 of this test case created by Fábio M. Costa

Preparation code

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

<script src="https://github.com/mootools/slick/raw/master/Source/Slick.Parser.js"></script>
<script src="https://github.com/mootools/slick/raw/master/Source/Slick.Finder.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script>

<div class="content">
<p></p>
</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
dojo.query(".content");
pending…
jQuery
jQuery('.content');
pending…
Slick
Slick.search(document, '.content');
pending…
jQuery - inside
jQuery('.content p');
pending…
Slick - inside
Slick.search(document, '.content p');
pending…
Dojo - inside
dojo.query(".content p");
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:

1 comment

Thomas Aylott commented :

Slick is faster for a simple className selector because it has a (removable) optimization for that specific selector.

A proper comparison would compare dozens of different selectors against a decently large document and THEN actually verify that the results are what you expect.

Add a comment