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
I'm looking into selectively firing functions based on the existence of a namespaced class or data attribute.
Imagine <div class="module-slider module-lightbox"> (or <div data-module="slider lightbox">) which would then fire or call a slider and lightbox plugins
The idea is that this would minfiy the potential impact of a required element not existing instead of relying on the function/plugin to do that.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<h1 class="moon">
Moon-
</h1>
<div class="moon moon-rock moon-light">
<h2 class="moon moon-light">
Moon Rock
</h2>
</div>
<div class="imitation moon moon-rock moon-phony">
<h2 data-moon="imitation moon-outrage moon-phony">
<em class="moon moon-outrage" data-moon="imitation moon-rock moon-phony">
Imitation
</em>
Moon Rock
</em>
</h2>
</div>
<div class="moon moon-shine" data-moon="moon-light">
<h2 class="moon" data-moon="moon-shine moon-light">
Moon Shine
</h2>
</div>
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery Class (Starts With) |
| ready |
jQuery Div Class (Starts With) |
| ready |
jQuery Data Attribute (Starts With) |
| ready |
jQuery Div Data Attribute (Starts With) |
| ready |
jQuery Data Attribute |
| ready |
jQuery Div Data Attribute |
| ready |
jQuery Class |
| ready |
jQuery Div Class |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.