jQuery vs Sizzle vs Midori vs YUI vs Peppy vs Dojo vs XUI - selectors test
JavaScript performance comparison
Info
Selectors test of 7 useful javascript frameworks
Preparation code
<script src="//xui-js.googlecode.com/files/xui-core-1.0.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script>
<script src="//jamesdonaghue.com/static/peppy/peppy-min.js"></script>
<script src="//www.midorijs.com/midori.js"></script>
<script src="//yui.yahooapis.com/2.8.1/build/yahoo/yahoo-min.js"></script>
<script src="//yui.yahooapis.com/2.8.1/build/selector/selector-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script>var j4 = jQuery.noConflict();</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js"></script>
<script>var j2 = jQuery.noConflict();</script>
<script src="//linkedin.com/lib/sizzle/1.0/sizzle.js"></script>
<div id="test">
<div class="testlink">
<a href="#" id="linkone" title="test">test link</a>
</div>
<div class="testmenu">
<ul>
<li class="menuitem itemone">
<a href="#" title="item 1">menu item 1</a>
</li>
<li class="menuitem itemtwo">
<a href="#" title="item 2">menu item 2</a>
</li>
<li class="menuitem itemthree">
not clickable item 3
</li>
</ul>
</div>
</div>
<script>
var selectors = ['body', 'div', 'body div', 'div a', 'div > a', 'div[class^=test]', 'div, li, a', '.menuitem', 'li.menuitem', '#linkone', 'div#test', 'a[title*=item]', 'a[title=test]', 'li:nth-child(even)', 'li:nth-child(odd)', 'li:last-child', 'li:first-child'];
dojo.require('dojo.query');
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
jQuery 1.4 (with Sizzle) |
|
pending… |
jQuery 1.2 (no Sizzle) |
|
pending… |
Sizzle |
|
pending… |
Midori |
|
pending… |
YUI |
|
pending… |
Peppy |
|
pending… |
Dojo |
|
pending… |
XUI |
|
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:
- Revision 1: published by niu tech
- Revision 2: published
- Revision 3: published by Renato Rodrigues
- Revision 4: published by Ryan Grove
- Revision 5: published by Nate Cavanaugh
- Revision 8: published by Jeff Craig
- Revision 14: published
- Revision 15: published
- Revision 16: published by Gildas
- Revision 17: published by Benjamin Young
- Revision 19: published by Dan Heberden
- Revision 20: published by Dan Heberden
- Revision 21: published by Dan Heberden
- Revision 22: published
- Revision 26: published by Addy Osmani
- Revision 27: published
- Revision 29: published
- Revision 30: published by Jesse Cravens
- Revision 31: published by 3
- Revision 32: published
- Revision 33: published
- Revision 34: published
- Revision 35: published by Adam Tybor
- Revision 36: published by Adam Tybor
- Revision 37: published by Adam Tybor
- Revision 38: published by cHao
- Revision 39: published
- Revision 41: published
- Revision 43: published
- Revision 44: published
- Revision 45: published
- Revision 46: published
0 comments