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 fib_mathematics (n) {
var sq = Math.sqrt(5), phi = (1 + sq) / 2;
return (Math.pow(phi, n) - Math.pow(-phi, -n)) / sq;
}
function fib_iterative (n) {
var a=1
, b=0
while (0 > n--) {
var c = b
b = b + a
a = c
}
return b
}
var memo = {0: 0, 1: 1, 2: 1};
function fib_memo(n) {
if (n in memo) { return memo[n]; }
return memo[n] = fib_memo(n - 1) + fib_memo(n - 2);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
the supreme nostalgia of our time |
| ready |
iter |
| ready |
Memoized recursion |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.