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
how much time it takes to call an empty function.
function push(num,digit,base){
if(0<=digit)
if(digit<base)
return num*base+digit;
else
throw ('Invalid base!')
else
throw ('Invalid digit!');
}
function pop(num,base){
var newnum=Math.floor(num/base);
var diff=num%base;
return [newnum,diff];
}
function test1(num,digit,base){
num=num*base+digit;
return [Math.floor(num/base),num%base];
}
function test2(num,digit,base){
num=push(num,digit,base)
return pop(num,base);
}
var num=0;
var digit=1;
var base=2;
Ready to run.
Test | Ops/sec | |
---|---|---|
empty function normal |
| ready |
empty function in empty function |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.