jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Tests handling the most basic selectors between qwery, sizzle, and minimal. Qwery and sizzle are both wonderful, but minimal is for those who want to always use only the most performant selectors. It forces you to do this by limiting the kinds of selectors it will treat. For instance, descendants are not allowed (e.g. '#parent #child'), nor css3 selectors, which is significantly slower than id, tag, or class (that is where getElementsByClassName is supported). qwery and sizzle will prefer these fast methods, but will do more checks and function calls. The ambition behind minimal is to create the fastest selector engine possible, even if it can't do everything.
<script src="https://github.com/jquery/sizzle/raw/master/sizzle.js"></script>
<script src="https://github.com/ded/qwery/raw/master/qwery.js"></script>
<script src="https://raw.github.com/timmywil/minimal/master/src/minimal.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>
Benchmark.count = 0;
Benchmark.prototype.setup = function() {
var Q = qwery,
S = Sizzle,
QA = queryAll;
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Qwery .d |
| ready |
Sizzle .d |
| ready |
Minimal .d |
| ready |
Qwery #boosh |
| ready |
Sizzle #boosh |
| ready |
Minimal #boosh |
| ready |
Query div |
| ready |
Sizzle div |
| ready |
Minimal div |
| ready |
Qwery div.a |
| ready |
Sizzle div.a |
| ready |
Minimal div.a |
| ready |
Qwery div.a, .d |
| ready |
Sizzle div.a, .d |
| ready |
Minimal div.a, .d |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.