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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script>
var arr = new Array(100);
for(var i=99; i>=0; --i) {
arr[i] = i+1;
}
arr = _.shuffle(arr);
var sum = 0;
</script>sum = 0;Ready to run.
| Test | Ops/sec | |
|---|---|---|
| jQuery.each implementation | | ready |
| LoDash forEach implementation | | ready |
| angular.forEach implementation | | ready |
| while loop that imitates a for loop | | ready |
| while loop that imitates a for loop, caching the length | | ready |
| Reverse while loop | | ready |
| Reverse while loop without implicit ToBoolean | | ready |
| Reverse do … while loop | | ready |
| Reverse for loop | | ready |
| Standard for loop | | ready |
| Standard for loop, caching the length | | ready |
| Standard for loop, noop in the iteration increment statement | | ready |
| Standard for loop, caching the length, noop in the iteration increment statement | | ready |
| Native Array#forEach implementation | | ready |
| Native Array#forEach implementation with named function | | ready |
| for var in implementation | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.