Node.js vs Deno vs Bun: Hello World Performance

Mayank Choubey
Tech Tonic

--

It’s been a while since I’ve looked at the performance battle between these technologies. The last such comparison was done more than six months (when Bun 1.0 was out). Since then, Node.js, Deno, (and especially) Bun has gone through a number of major and minor releases. There have been numerous requests to carry out some useful comparisons again. I’ll start with the usual hello world (native), which will be followed by a hello world (framework), JWT+DB read server, some CPU intensive server, a Docker containerized server, etc.

I’m aware that a hello world test is far from reality. However, that’s how I like to start.

Article 2 of this series is out: Node.js vs Deno vs Bun Database reads performance

Test setup

All tests have been executed on MacBook Pro M2 with 8+4 cores & 16G of RAM. The software versions are:

  • Node.js v22.1.0
  • Deno v1.43.1
  • Bun v1.1.7

All tests are executed using Bombardier test tool.

The application code is as follows:

Node.js

import http from "node:http";

http.createServer((req, resp) => {
resp.writeHead(200, {
"content-type": "text/plain",
});
resp.end("Hello world!");
}).listen(3000);

Deno

Deno.serve({
port: 3000,
}, (req) => new Response("Hello world!"));

Bun

Bun.serve({
port: 3000,
fetch: (req) => new Response("Hello world!"),
});

Results

A total of 10M requests are executed for 100 and 300 concurrent connections. Readings are taken for time taken, RPS, and latency. Additionally, readings are taken for CPU and memory usage. The cost of performance is as important as the performance.

The results in chart form are as follows:

Verdict

For the simplest (far from reality) hello world case, Bun is the winner in all the measurements. Bun is ~2x faster than Node, and ~1.5x faster than Deno. The CPU usage is the same for all. Bun’s memory usage is fairly low, 3x less than Node, and 2–3x less than Deno.

Overall winner for this simplest test: BUN

Thanks for reading this!

Article 2 of this series is out: Node.js vs Deno vs Bun Database reads performance

As I’m onto this now, please let me know if you have any ‘real-world’ benchmarks that you would like me to try for these three.

--

--