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
Simple test cases to show methods for transforming strings pulled from the DOM into integers.
<div id="box1" style="width:200px; height:10px;"> </div>
<div id="box2" style="width:400px; height:5px;"> </div>
<input type="hidden" value="20" id="testinput"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
var box1 = $("#box1"),
box2 = $("#box2"),
box1el = box1[0],
box2el = box2[0],
testinput = $("#testinput"),
testinputel = testinput[0];
Ready to run.
Test | Ops/sec | |
---|---|---|
jquery get and parseint |
| ready |
jquery get and parseint with set radix |
| ready |
jquery get and slice bitshift |
| ready |
parseInt cached |
| ready |
parseInt cached with set radix |
| ready |
slice bitshift cache |
| ready |
el + slice + cast |
| ready |
el + slice + notnot |
| ready |
el + slice + bitshift |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.