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
var array = [];
for (var q = 0; q < 1000; q++) {
array[q] = q;
}
var func = function(ele, idx) {
ele + idx
};
Array.prototype.forEach2 = function(a) {
var l = this.length;
for (var i = 0; i < l; i++) a(this[i], i)
}
Array.prototype.map2 = function(a) {
var l = this.length;
var array = new Array(l),
i = 0;
for (; i < l; i++) {
array[i] = a(this[i], i)
}
return array;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
for |
| ready |
foreach |
| ready |
custom foreach |
| ready |
map |
| ready |
custom map |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.