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
function createTestArray (iterations) {
var arr = [];
var i = 0;
for (loop = 0; loop < iterations; loop++) {
var random = Math.random();
random = random.toString();
random = random.substr(2);
arr.push(random);
// 1/3 of times, add a duplicate element
if (i++ === 3) {
// reset i
i = 0;
arr.push(random);
}
}
return arr;
}
var testArray = createTestArray(500);
Ready to run.
Test | Ops/sec | |
---|---|---|
Hash sieving |
| ready |
IndexOf |
| ready |
array.filter |
| ready |
Fast Algorithm |
| ready |
Fast Algorithm Optimized |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.