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
Fastest method for looping through an array of 1024 items and do a minimal operation with the new value each time.
Test rendered values here : http://jsfiddle.net/molokoloco/qeWhB/
<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
// Populate the base array
var arr = [];
for (var i = 0; i < 1024; i++) arr[i] = i;
Ready to run.
Test | Ops/sec | |
---|---|---|
for() |
| ready |
for() caching |
| ready |
for() decrement |
| ready |
for (..in) |
| ready |
while() acting like for() |
| ready |
while() caching |
| ready |
while() in decrement |
| ready |
while(..pop()) |
| ready |
do while() |
| ready |
forEach() |
| ready |
map() |
| ready |
$.each() |
| ready |
_.each() |
| ready |
for (..pop()) - reverse order |
| ready |
for (..shift()) - keep order |
| ready |
Generator (JS 1.7) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.