> The site presents Deno 2 as if it has finally beat Bun in terms of performance
Bun's HTTP server performs 51% faster before parallelism. Their benchmark is incorrect. They posted a correction, and their correction is also incorrect. Benchmarking correctly is hard, and we put a lot of effort into making sure our benchmarks are easily reproducible.
Bun v1.1.30: 283,386 requests per second (51% faster)
Deno v2.0.0: 187,359 requests per second
Deno v1.45.5: 185,522 requests per second
The following code:
let i = 0;
export default {
async fetch(request: Request): Promise {
return new Response(`Hello, world! ${i++}`);
},
};
Run with:
oha -c 10 -n 10000000 --disable-compression http://localhost:{port}
This was tested on a Linux x64 machine running Debian 11 with a 32 core Intel i9-13900 CPU and 64GB of RAM. In this benchmark, the HTTP server runs on a single thread, so the CPU core count is not as relevant but still worth mentioning.
If we increase the number of concurrent connections from 10 to 1,000 - Bun's HTTP server performs 267% faster.
Bun v1.1.30: 209,133 requests per second (267% faster)
Deno v2.0.0: 78,289 requests per second
Deno v1.45.5: 76,628 requests per second
Run with:
oha -c 1000 -n 10000000 --disable-compression http://localhost:{port}
Note that we add the --disable-compression for Deno's benefit here (as it does nothing for Bun right now)
Have not yet spent enough time investigating their other benchmarks.