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
A quick test to see the performance based on using jQuery's .attr('class') versus the native className;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<div class="wrapper">
<div class="innerWrapper">
<div id="getMe" class="button">
<a href="javascript:void(0)" id="button" class="buttonRef">
<span class="buttonText">Text</span>
</a>
</div>
</div>
</div>
<script>
var jElem = $("#getMe");
var dElem = document.getElementById("getMe");
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
1. jQuery - get Element + get Class |
| ready |
2. GET DOM ELEM + get Class |
| ready |
3. jQuery get Class |
| ready |
4. DOM get class |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.