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
Array size = 40; Removed some obscure cases which were not faster on any of the platforms
var arr = [];
for(var i = 0; i < 40; i++) {
arr[i] = i+1;
}
// Old browser legacy
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(fun) {
var len = this.length;
for (var i = 0; i < len; ++i)
fun(this[i]);
};
}
Ready to run.
Test | Ops/sec | |
---|---|---|
01) Naive "while" loop + length caching |
| ready |
02) Naive "for" loop |
| ready |
03) Naive "for" loop + length caching |
| ready |
04) Presave "for" loop |
| ready |
05) Presave "for" loop + length caching |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.