Qwery vs Sizzle (v21)

Revision 21 of this benchmark created on


Description

Checking perf for basic selectors. Each revision will contain different tests.

Preparation HTML

<script src="http://s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
<script src="https://raw.github.com/jquery/sizzle/master/sizzle.js"></script>
<script src="https://github.com/ded/qwery/raw/master/qwery.js"></script>
<div foo="bar"></div>
<div class="a"></div>
<div id="boosh">
  <div class="a b">
    <div class="d e" test="fg" id="booshTest"></div>
    <em test="f g"></em>
    <span class="h i a"></span>
  </div>
</div>
<div id="attr-test1"></div>
<div id="attr-test2"></div>
<div id="attr-test3" class="found you" title="whatup duders"></div>

Setup

Benchmark.count = 0;
  Benchmark.prototype.setup = function() {
NW.Dom.configure( { USE_QSAPI: false } );
  };
   var N = NW.Dom.select,
       Q = qwery,
       S = Sizzle,
       c = 0,
       id = "boosh" + (Benchmark.count += this.count),
       el = document.getElementById('boosh');
Q.configure({
  useNativeQSA: false
});

Teardown


   el.id = 'boosh';
  

Test runner

Ready to run.

Testing in
TestOps/sec
Qwery div
el.id = id + (++c);
Q('div, #' + id + c);
ready
Sizzle div
el.id = id + (++c);
S('div, #' + id + c);
ready
NWMatcher div
el.id = id + (++c);
N('div, #' + id + c);
ready

Revisions

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