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
We're comparing the performance of a jQuery selector that selects a data attribute AND its value, and another without the value
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="test">
<div class="yj-chat-menu-user">
<button class="yj-chat-menu-item unstyle-button-as-div js-open-chat" data-js-open-chat data-js-open-chat-val="1">
<img src="http://placehold.it/24x24" alt="" width="24" height="24">
<div class="yj-presence yj-chat-user-presence yj-online" data-yj-user-id="1337">
<span class="yj-acc-hidden">online</span>
</div>
<div class="yj-chat-user-name">John Stamos</div>
<div class="yj-chat-user-job">Jessee And The Rippers</div>
</button>
<button class="yj-chat-menu-item unstyle-button-as-div js-open-chat" data-js-open-chat data-js-open-chat-val="1">
<img src="http://placehold.it/24x24" alt="" width="24" height="24">
<div class="yj-presence yj-chat-user-presence yj-online" data-yj-user-id="1337">
<span class="yj-acc-hidden">online</span>
</div>
<div class="yj-chat-user-name">John Stamos</div>
<div class="yj-chat-user-job">Jessee And The Rippers</div>
</button>
<button class="yj-chat-menu-item unstyle-button-as-div js-open-chat" data-js-open-chat data-js-open-chat-val="1">
<img src="http://placehold.it/24x24" alt="" width="24" height="24">
<div class="yj-presence yj-chat-user-presence yj-online" data-yj-user-id="1337">
<span class="yj-acc-hidden">online</span>
</div>
<div class="yj-chat-user-name">John Stamos</div>
<div class="yj-chat-user-job">Jessee And The Rippers</div>
</button>
</div>
</div>
var div = $('#test')
Ready to run.
Test | Ops/sec | |
---|---|---|
dataSelectorWithVal |
| ready |
dataSelectorWithOutVal |
| ready |
classSelector |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.