Benchmarks
Overview
HTTP benchmark suite comparing Rune with other popular web frameworks, plus middleware, GraphQL, and Socket benchmarks. Benchmarks live in benchmarks/ at the repo root.
Frameworks Tested
| Framework | Description |
|---|---|
| Rune | Web-standard, runtime-agnostic backend framework |
| Hono | Ultra-fast web framework for the Edges |
| Elysia | Fast, and friendly Bun web framework |
| Fastify | Fast and low overhead web framework |
| Node.js HTTP | Native Node.js http module |
| Koa | Expressive middleware for Node.js |
| Express | Minimal and flexible Node.js web framework |
Routes Tested
Each framework benchmark tests the following routes:
| Route | Method | Description |
|---|---|---|
/hello | GET | Static route returning JSON |
/user/:id | GET | Parameterized route extracting path param |
/search | GET | Query string parameters |
/echo | POST | Request body handling |
Additional Benchmarks
| Benchmark | Description |
|---|---|
| Middleware | HTTP throughput with all built-in middleware loaded |
| Perf Middleware | Direct middleware function microbenchmark |
| Router | Direct route matching microbenchmark |
| Query Param | Direct query string parsing microbenchmark |
| Event Bus | Event emission and handling microbenchmark |
| GraphQL | GraphQL query execution (simple, variable, POST) |
| Socket | Socket connection management and broadcast |
Latest Framework Results
Results from bun run bench (GET: 50,000 iterations, POST: 25,000 iterations, concurrency: 20):
| Framework | GET /hello | GET /user/:id | GET /search | POST /echo |
|---|---|---|---|---|
| Elysia | 62,771 ops/sec | 62,590 ops/sec | 54,693 ops/sec | 36,364 ops/sec |
| Node.js HTTP | 31,880 ops/sec | 39,121 ops/sec | 32,209 ops/sec | 20,795 ops/sec |
| Fastify | 26,188 ops/sec | 28,892 ops/sec | 26,687 ops/sec | 14,723 ops/sec |
| Hono | 21,931 ops/sec | 24,125 ops/sec | 22,093 ops/sec | 7,694 ops/sec |
| Koa | 21,110 ops/sec | 21,634 ops/sec | 20,264 ops/sec | 14,842 ops/sec |
| Express | 19,608 ops/sec | 20,044 ops/sec | 17,036 ops/sec | 10,588 ops/sec |
| Rune | 13,708 ops/sec | 15,068 ops/sec | 15,311 ops/sec | 8,930 ops/sec |
Measured on GitHub Actions
ubuntu-latestusing Bun 1.4.0. Results may vary by environment.
Adapter Benchmarks
HTTP throughput comparison of Rune running on different runtime and framework adapters.
Runtime Adapters
| Adapter | Description |
|---|---|
| Bun | Rune via @rune/adapter-bun (Bun.serve) |
| Node.js | Rune via @rune/adapter-node (Node.js http) |
Framework Adapters
Rune wrapped inside another framework via its adapter.
| Adapter | Description |
|---|---|
| Elysia | Rune via @rune/adapter-elysia |
| Fastify | Rune via @rune/adapter-fastify |
| Koa | Rune via @rune/adapter-koa |
| Express | Rune via @rune/adapter-express |
| Hono | Rune via @rune/adapter-hono |
| h3 | Rune via @rune/adapter-h3 |
Latest Adapter Results
Results from bun run bench:adapters (GET: 50,000 iterations, POST: 25,000 iterations, concurrency: 100):
| Adapter | GET /hello | GET /user/:id | GET /search | POST /echo |
|---|---|---|---|---|
| Bun | 45,725 ops/sec | 44,032 ops/sec | 35,664 ops/sec | 5,519 ops/sec |
| Elysia | 43,632 ops/sec | 40,304 ops/sec | 32,651 ops/sec | 5,262 ops/sec |
| Node.js | 16,352 ops/sec | 16,429 ops/sec | 15,498 ops/sec | 9,056 ops/sec |
| Fastify | 16,215 ops/sec | 16,054 ops/sec | 13,471 ops/sec | 8,345 ops/sec |
| Koa | 14,403 ops/sec | 14,283 ops/sec | 13,621 ops/sec | 10,732 ops/sec |
| Express | 13,433 ops/sec | 13,791 ops/sec | 11,824 ops/sec | 10,656 ops/sec |
| h3 | 8,005 ops/sec | 8,031 ops/sec | 8,059 ops/sec | 4,676 ops/sec |
| Hono | 7,942 ops/sec | 7,963 ops/sec | 7,899 ops/sec | 4,468 ops/sec |
Measured on the same machine under identical load. Results may vary by environment.
Running Benchmarks
Install Dependencies
bun installRun All Benchmarks
bun run bench:allRun Individual Framework Benchmarks
bun run bench:rune # Runebun run bench:hono # Honobun run bench:elysia # Elysiabun run bench:fastify # Fastifybun run bench:node # Node.js native HTTPbun run bench:koa # Koabun run bench:express # ExpressRun Additional Benchmarks
bun run bench:middleware # Middleware throughputbun run bench:perf-middleware # Middleware microbenchmarkbun run bench:router # Router microbenchmarkbun run bench:query-param # Query param microbenchmarkbun run bench:event-bus # Event bus microbenchmarkbun run bench:graphql # GraphQL query executionbun run bench:socket # Socket operationsRun Adapter Benchmarks
bun run bench:adapter-node # Rune via Node.js adapterbun run bench:adapter-bun # Rune via Bun adapterbun run bench:adapter-elysia # Rune via Elysia adapterbun run bench:adapter-hono # Rune via Hono adapterbun run bench:adapter-express # Rune via Express adapterbun run bench:adapter-koa # Rune via Koa adapterbun run bench:adapter-fastify # Rune via Fastify adapterbun run bench:adapter-h3 # Rune via h3 adapterbun run bench:adapters # All adapter benchmarksBenchmark Configuration
Output Fields
| Field | Description |
|---|---|
ops/sec | Operations per second |
ms/op | Average latency per operation in milliseconds |
Each benchmark runs:
- GET routes: 50,000 iterations
- POST routes: 25,000 iterations
Results are measured using performance.now() with parallel request batching.
Project Structure
benchmarks/├── http.ts # Shared HTTP benchmarking utilities├── _app.ts # Shared Rune app for Rune benchmark├── measure.ts # Microbenchmark measurement utility├── runner.ts # Main runner for all framework benchmarks├── rune.ts # Rune framework benchmark├── hono.ts # Hono framework benchmark├── elysia.ts # Elysia framework benchmark├── fastify.ts # Fastify framework benchmark├── node.ts # Node.js native HTTP benchmark├── koa.ts # Koa framework benchmark├── express.ts # Express framework benchmark├── middleware.ts # Middleware throughput benchmark├── perf-middleware.ts # Middleware microbenchmark├── router.ts # Router microbenchmark├── query-param.ts # Query param microbenchmark├── event-bus.ts # Event bus microbenchmark├── graphql.ts # GraphQL query execution benchmark├── socket.ts # Socket operations benchmark├── adapter-bun.ts # Rune via Bun adapter benchmark├── adapter-node.ts # Rune via Node.js adapter benchmark├── adapter-elysia.ts # Rune via Elysia adapter benchmark├── adapter-hono.ts # Rune via Hono adapter benchmark├── adapter-express.ts # Rune via Express adapter benchmark├── adapter-koa.ts # Rune via Koa adapter benchmark├── adapter-fastify.ts # Rune via Fastify adapter benchmark├── adapter-h3.ts # Rune via h3 adapter benchmark├── adapter-runner.ts # Adapter benchmarks runner + report├── tests/ # Test files for benchmarks├── package.json # Dependencies and scripts├── tsconfig.json # TypeScript configuration└── README.md # Benchmark details and latest resultsNotes
- Each benchmark starts its own server on a different port
- Benchmarks run sequentially to avoid port conflicts
waitForServer()retries until each server is ready before starting measurements- Parallel requests with keep-alive connections are used for throughput measurement
- All benchmarks use the same request/response patterns for fair comparison
- Latest results are auto-generated in
benchmarks/README.mdby the runner scripts