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
Yea...
function inArgsOutArr(a, b){
return [a,b];
}
function inArgsOutObj(a, b){
return {a, b};
}
function inArrOutArr([a, b]){
return [a,b];
}
function inArrOutObj([a, b]){
return {a, b};
}
function inObjOutArr({a, b}){
return [a, b];
}
function inObjOutObj({a, b}){
return {a, b};
}
function inArrOutArrD(arr){
const [a, b] = arr;
return [a, b];
}
function inArrOutObjD(arr){
const [a, b] = arr;
return {a, b};
}
function inArr2OutArrD(arr){
const {0:a, 1:b} = arr;
return [a, b];
}
function inArr2OutObjD(arr){
const {0: a, 1:b} = arr;
return {a, b};
}
function inObjOutArrD(obj){
const {a, b} = obj;
return [a, b];
}
function inObjOutObjD(obj){
const {a, b} = obj
return {a, b};
}
Ready to run.
Test | Ops/sec | |
---|---|---|
In separate arguments, out array |
| ready |
In separate arguments, out object |
| ready |
In array (destruct in args), out array |
| ready |
In array (destruct in args), out array |
| ready |
In object (destruct in args), out array |
| ready |
In object (destruct in args), out array |
| ready |
In array (destruct in body), out array |
| ready |
In array (destruct in body), out object |
| ready |
In array (destruct in body as object), out array |
| ready |
In array (destruct in body as object), out object |
| ready |
In object (destruct in body), out array |
| ready |
In object (destruct in body), out object |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.