Node.js Startup: comparing to Deno & Bun
Tags: nodejs-startup
A blog reader suggested that we also benchmark startup for two up-and-coming Javascript runtimes: Deno & Bun. Both of these runtimes are less mature than Node.js, and startup time is a very narrow benchmark, so please don’t interpret anything here as being some sort of general statement.
Because these runtimes are evolving so fast, here’s the versions I’m using for testing:
$ ~/.deno/bin/deno --version
deno 1.33.2 (release, x86_64-unknown-linux-gnu)
v8 11.4.183.1
typescript 5.0.3
$ ~/.bun/bin/bun --version
0.5.9
$ node --version
v21.0.0-pre
# (4040a904dedfae8e1a60cc29ed78aab7945d272f)
Now we can collect the startup time & memory usage using the same methodology as in the intro.
Bun’s startup is significantly (3x) faster than both Deno’s and Node’s. Applying all of my improvements to Node closes the gap to ~2x:
It’ll be interesting to see how these two runtimes evolve: it’s possible they’ll end up slower than Node as they add more features, or maybe Bun’s JSC core is just intrinsically better suited for fast startup than Node/Deno’s V8.