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 = [1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,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5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1,2,3,4,5,9,2,4,1];
function s1(array, callback){
var i,
sum = 0
;
for(i = 0; i < array.length; i++){
if(array.hasOwnProperty(i)){
sum += callback ? callback.call(array[i], array[i], i, array) : array[i];
}
}
return sum;
}
function s2(array, callback){
var i,
sum = 0
;
if(callback){
for(i = 0; i < array.length; i++){
if(array.hasOwnProperty(i)){
sum += callback.call(array[i], array[i], i, array);
}
}
}else{
for(i = 0; i < array.length; i++){
if(array.hasOwnProperty(i)){
sum += array[i];
}
}
}
return sum;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
1 |
| ready |
2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.