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 fiboRec(num) {
if (num <= 1) return 1;
return fiboRec(num - 1) + fiboRec(num - 2);
}
function fiboRec2(index, prev = 0, curr = 1){
if (index > 1){
return f(index - 1, curr, prev+curr);
}
else {
return curr;
}
}
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 | |
---|---|---|
Rec |
| ready |
Loop |
| ready |
Mem |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.