There have been changes recently with runtime choice for Node like environments, namely
Where requests/s is a good proxy metric for performance, I wanted to see how the runtimes handled actual computation complexity
First test is a tail call recursive Fibonacci implementation
function fibonacci(n: number): number {
if (n <= 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
Secondly we combine that with some React render to string
renderToString(
<body>
<h1>Hello, world</h1>
<h2>Here are the next X fibonacci numbers</h2>
<section>
<p>Fibonacci 0: 0</p>
<p>Fibonacci 1: 0</p>
<!-- ... -->
<p>Fibonacci X: ???</p>
</section>
</body>
)
make install
make bench # ITER=40 - Number of iterations of fibonacci to call