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 fiboLoop(num){
var a = 1, b = 0, temp;
while (num >= 0){
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
function fibRec(a, b, n) { if(n) return fib(b, a + b, n — 1); else return a }
function fiboMemo(num, memo) {
memo = memo || {};
if (memo[num]) return memo[num];
if (num <= 1) return 1;
return memo[num] = fiboMemo(num - 1, memo) + fiboMemo(num - 2, memo);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Recursive |
| ready |
Memoization |
| ready |
Loop |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.