Skip to content

domtronn/benchmark-runtimes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Runtime analysis

There have been changes recently with runtime choice for Node like environments, namely

  1. NodeJS 20
  2. Deno
  3. Bun

Where requests/s is a good proxy metric for performance, I wanted to see how the runtimes handled actual computation complexity

The 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>
)

Running it

make install
make bench # ITER=40 - Number of iterations of fibonacci to call

About

Benchmarking new JS runtimes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published