Qwery vs Sizzle (v7)

Revision 7 of this benchmark created on


Description

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

Preparation HTML

<script src="https://github.com/dperini/nwmatcher/raw/master/src/nwmatcher.js"></script>
<script src="https://github.com/jquery/sizzle/raw/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() {
   var N = NW.Dom.select,
       Q = qwery,
       S = Sizzle,
       c = 0,
       cn = "e" + (Benchmark.count += this.count),
       el = document.getElementById("booshTest");
  };

Test runner

Ready to run.

Testing in
TestOps/sec
Qwery #boosh .e
el.className = "d " + cn + (++c);
Q('#boosh .' + cn + c);
ready
Sizzle #boosh .e
el.className = "d " + cn + (++c);
S('#boosh .' + cn + c);
ready
NWMatcher #boosh .e
el.className = "d " + cn + (++c);
N('#boosh .' + cn + c);
ready

Revisions

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