YUI v3.13.0 vs. jQuery v1.10.2

JavaScript performance comparison

Revision 55 of this test case created

Info

Rev.49:

Preparation code

<script src="https://raw.github.com/yui/yui2/master/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.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>
Benchmark.prototype.setup = function() {
    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'];
};
</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.9
for (var sel in selectors) {
  $(selectors[sel]).length;
}
pending…
YUI v2.8.1
for (var sel in selectors) {
  YAHOO.util.Selector.query(selectors[sel]).length;
}
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