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>
function randomArray(count) {
var array = [];
for (i = 0; i < count; i++) {
array.push(Math.floor(Math.random() * 1000000));
}
return array;
}
function custom_min(array) {
var min_value = array[0];
for (var i = 1, l = array.length; i < l; i++) {
if (array[i] < min_value) {
min_value = array[i];
}
}
return min_value;
}
var ten = randomArray(10);
var hundred = randomArray(100);
var ten_thousand = randomArray(10000);
var million = randomArray(1000000);
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Math.min.apply - 100 |
| ready |
Custom - 100 |
| ready |
Math.min.apply - 10,000 |
| ready |
Custom - 10,000 |
| ready |
Math.min.apply - 1,000,000 |
| ready |
Custom - 1,000,000 |
| ready |
Math.min.apply - 10 |
| ready |
Custom - 10 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.