jQuery vs XUI - selectors test (v46)

Revision 46 of this benchmark created on


Description

Selectors test of 7 useful javascript frameworks

Preparation HTML

<script src="//xui-js.googlecode.com/files/xui-core-1.0.0.js">
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<script>
  var j4 = jQuery.noConflict();
</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>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery 1.4 (with Sizzle)
for (var sel in selectors) {
  j4(sel);
}
ready
jQuery 1.2 (no Sizzle)
 
ready
Sizzle
 
ready
Midori
 
ready
YUI
 
ready
Peppy
 
ready
Dojo
 
ready
XUI
for (var sel in selectors) {
  x$(sel);
}
ready

Revisions

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