Throughput and latency,
with the full stack on.
MiiaJS next to Hono, Elysia, Fastify and NestJS on Bun, Deno and Node.js. The realistic tests run with CORS, JWT, routing, body parsing and validation enabled; the synthetic ones measure bare framework overhead.
Realistic API
Full middleware stack - CORS, JWT, routing, body parsing, validation. The way real APIs work.
GET /api/users/:userId/posts/:postId
CORS, JWT verification, nested route params, JSON response.
POST /api/workspaces/:ws/projects/:proj/tasks
CORS, JWT, JSON body, path and query params, custom headers, UUID, 201 status. The heaviest test.
Synthetic
Minimal handlers - pure framework overhead with no middleware. Bare routers have a natural edge here.
GET /
Returns { "message": "Hello, World!" }. No middleware, no parsing.
POST /json
Parse a JSON body, generate a UUID, return a response.
How it is measured
All benchmarks run under controlled conditions with randomized server order to reduce bias.
Load parameters
- Autocannon v8+
- 100 concurrent
- 30 s per pass
- 5 s at full connections, for the JIT
- 5, averaged with stddev
- 1, single-threaded, no clustering
What the API scenarios test
- Origin validation and preflight headers
- Bearer token extraction and HS256 verification
- Path parameters from nested segments
- JSON deserialization, POST scenarios
- URL search parameter extraction
- JSON serialization with custom status codes
Test machines
Apple M1 Pro
2×Intel Xeon Gold 5218R
Frameworks compared
- MiiaJS0.6.0Decorator-driven, DI, guards, middleware · Bun, Deno, Node (+ uWS adapter)
- Hono4.13.3Lightweight multi-runtime router · Bun, Deno, Node (+ uWS adapter)
- Elysia1.4.29Bun-native framework · Bun
- Fastify5.12.1Plugin-based Node.js framework · Bun, Node
- NestJS + Fastify11.2.1Enterprise decorator framework · Bun, Node
| framework | version | type | runtimes |
|---|---|---|---|
| MiiaJS | 0.6.0 | Decorator-driven, DI, guards, middleware | Bun, Deno, Node (+ uWS adapter) |
| Hono | 4.13.3 | Lightweight multi-runtime router | Bun, Deno, Node (+ uWS adapter) |
| Elysia | 1.4.29 | Bun-native framework | Bun |
| Fastify | 5.12.1 | Plugin-based Node.js framework | Bun, Node |
| NestJS + Fastify | 11.2.1 | Enterprise decorator framework | Bun, Node |
Hono uWS uses the same @miiajs/uws-server adapter (uWebSockets.js 20.69.0), so the difference is pure framework overhead.
Where the speed comes from
Core
- Trie-based router - O(1) static path lookup
- Compile-time pipelines - middleware chains resolved once at startup, not per request
- Sync fast path - no Promise for a synchronous handler on a route without middleware, guards or schemas
- No runtime reflection - native decorators resolve at class definition
- Minimal allocations - no wrapper objects between your handler and the runtime
Node.js and uWebSockets adapters
- Lazy Request and Headers proxy - no allocation until accessed
- Body buffering - small payloads skip the ReadableStream overhead
- LightResponse cache - status, body and headers without constructing a real Response
Run it yourself
The benchmark suite is open source. Its CLI lets you pick scenarios, runtimes and the number of passes.
github.com/miiajs/benchmarksgit clone https://github.com/miiajs/benchmarks.git
cd benchmarks
bun install
bun run bench