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
Testing selector matching using mozMatchesSelector
(implemented "matchesSelector
" in Firefox)
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="level1">
<div class="level2">
<div class="level3">
<div class="level4">
<div class="level5" id="foo">
</div>
<div class="level5">
</div>
<div class="level5">
</div>
</div>
</div>
</div>
</div>
<script>
(function(docEl, $) {
$.fn.matching = docEl.mozMatchesSelector ?
function(selector) {
return this[0].mozMatchesSelector(selector);
} : $.fn.is;
})(document.documentElement, jQuery);
var elements = jQuery('.level1 .level2 .level3 .level4 .level5');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Using $.fn.is |
| ready |
Using mozMatchesSelector |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.