Files
bun.sh/bench/express
Alistair Smith 6e063fa57b Use "module": "Preserve" (#19655)
Co-authored-by: Matt Pocock <mattpocockvoice@gmail.com>
2025-05-14 18:43:15 -07:00
..
2025-01-21 07:55:41 -08:00
2025-01-21 07:55:41 -08:00
2025-01-21 07:55:41 -08:00
2025-01-21 07:55:41 -08:00
2025-01-21 07:55:41 -08:00

express benchmark

This benchmarks a hello world express server.

To install dependencies:

bun install

To run in Bun:

bun ./express.mjs

To run in Node:

node ./express.mjs

To run in Deno:

deno run -A ./express.mjs

To benchmark each runtime:

oha http://localhost:3000 -n 500000 -H "Accept-Encoding: identity"

We recommend using oha or bombardier for benchmarking. We do not recommend using ab, as it uses HTTP/1.0 which stopped being used by web browsers in the early 2000s. We also do not recommend using autocannon, as the node:http client is not performant enough to measure the throughput of Bun's HTTP server.

Note the Accept-Encoding: identity header exists to prevent Deno's HTTP server from compressing the response.