YUI v3.4.1 vs. jQuery v1.7 DOM queries

JavaScript performance comparison

Revision 25 of this test case created by Kevin

Info

simple selector tests

Preparation code

<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js">
</script>
<script src="http://code.jquery.com/jquery-1.7.min.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 = ['.menuitem', 'li.menuitem', '#linkone', 'div#test', 'a[title*=item]', 'a[title=test]'];
var Y = YUI().use('node-base', 'selector-css3');

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

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
jQuery v1.7
for (var sel in selectors) {
  $(sel);
}
pending…
YUI v3.4.1
for (var sel in selectors) {
  Y.all(sel);
}
 
pending…
YUI v3.4.1 Selector class
for (var sel in selectors) {
  Y.Selector.query(sel);
}
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