Adam K Dean

Benchmarking Node HTTP Frameworks

Published on 8 August 2025 at 09:00 by Adam

Today I benchmarked four different ways of handling HTTP requests in Node: native HTTP, h3, Fastify, and Express. The goal was to get a clear idea of the performance differences between them for a very simple JSON response.

Test setup

I kept the conditions consistent to make the comparison fair:

  • One route: GET /json returning { ok: true }
  • Same machine, same Node version, single process
  • NODE_ENV=production, keep alive on, HTTP/1.1
  • Warmup before each run
  • Tooling: autocannon
  • Concurrency levels: 50, 200, 500

Results

http benchmark results

Requests per second, mean, at each concurrency level:

  • native HTTP: ~105k @ 50c, ~104k @ 200c, ~103k @ 500c
  • h3: ~104k @ 50c, ~104k @ 200c, ~98k @ 500c
  • Fastify: ~98k @ 50c, ~97k @ 200c, ~95k @ 500c
  • Express: ~23k for all concurrencies

Latency stayed extremely low for native HTTP, h3, and Fastify until high concurrency, with Express showing consistently higher values.

Interpretation

Native HTTP came out on top, with h3 close behind. Fastify is only a few percent slower while providing more features out of the box, making it a strong option for most real-world APIs. Express is much slower in this kind of benchmark, which is expected given its older architecture and heavier middleware stack.

These results reinforce the idea that if throughput is critical and your routes are lightweight, modern frameworks like h3 or Fastify give you strong performance while still offering useful abstractions. Express remains a fine choice for smaller tools or where developer familiarity matters more than raw speed.

Next steps?

TBD



This post was first published on 8 August 2025 at 09:00. It was filed under programming with tags programming, node.js, express, h3, fastify, http.