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 speed of selection for data attribute selection versus class-based selection.
<ul>
<li id="1a" data-cargroup="abcde" class="a b c d e">A</li>
<li id="2b" data-cargroup="bcdea" class="b c d e a>B</li>
<li id="3c" data-cargroup="cdeab" class="c d e a b">C</li>
<li id="4d" data-cargroup="deabc" class="d e a b c">C</li>
<li id="5e" data-cargroup="eabcd" class="e a b c d">D</li>
<li id="1f" data-cargroup="abcde" class="a b c d e">A</li>
<li id="2g" data-cargroup="bcdea" class="b c d e a>B</li>
<li id="3h" data-cargroup="cdeab" class="c d e a b">C</li>
<li id="4i" data-cargroup="deabc" class="d e a b c">C</li>
<li id="5j" data-cargroup="eabcd" class="e a b c d">D</li>
<li id="1z" data-cargroup="abcde" class="a b c d e">A</li>
<li id="2k" data-cargroup="bcdea" class="b c d e a>B</li>
<li id="3l" data-cargroup="cdeab" class="c d e a b">C</li>
<li id="4m" data-cargroup="deabc" class="d e a b c">C</li>
<li id="5n" data-cargroup="eabcd" class="e a b c d">D</li>
<li id="1o" data-cargroup="abcde" class="a b c d e">A</li>
<li id="2p" data-cargroup="bcdea" class="b c d e a>B</li>
<li id="3q" data-cargroup="cdeab" class="c d e a b">C</li>
<li id="4r" data-cargroup="deabc" class="d e a b c">C</li>
<li id="5s" data-cargroup="eabcd" class="e a b c d">D</li>
<li id="1t" data-cargroup="abcde" class="a b c de">A</li>
<li id="2u" data-cargroup="bcdea" class="b c d e a>B</li>
<li id="3v" data-cargroup="cdeab" class="c d e a b">C</li>
<li id="4w" data-cargroup="deabc" class="d e a b c">C</li>
<li id="5x" data-cargroup="eabcd" class="e a b c d">D</li>
</ul>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Data-attribute selection |
| ready |
Class-based selection |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.