Skip to content

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

FrameworkDescription
RuneWeb-standard, runtime-agnostic backend framework
HonoUltra-fast web framework for the Edges
ElysiaFast, and friendly Bun web framework
FastifyFast and low overhead web framework
Node.js HTTPNative Node.js http module
KoaExpressive middleware for Node.js
ExpressMinimal and flexible Node.js web framework

Routes Tested

Each framework benchmark tests the following routes:

RouteMethodDescription
/helloGETStatic route returning JSON
/user/:idGETParameterized route extracting path param
/searchGETQuery string parameters
/echoPOSTRequest body handling

Additional Benchmarks

BenchmarkDescription
MiddlewareHTTP throughput with all built-in middleware loaded
Perf MiddlewareDirect middleware function microbenchmark
RouterDirect route matching microbenchmark
Query ParamDirect query string parsing microbenchmark
Event BusEvent emission and handling microbenchmark
GraphQLGraphQL query execution (simple, variable, POST)
SocketSocket connection management and broadcast

Latest Framework Results

Results from bun run bench (GET: 50,000 iterations, POST: 25,000 iterations, concurrency: 20):

FrameworkGET /helloGET /user/:idGET /searchPOST /echo
Elysia62,771 ops/sec62,590 ops/sec54,693 ops/sec36,364 ops/sec
Node.js HTTP31,880 ops/sec39,121 ops/sec32,209 ops/sec20,795 ops/sec
Fastify26,188 ops/sec28,892 ops/sec26,687 ops/sec14,723 ops/sec
Hono21,931 ops/sec24,125 ops/sec22,093 ops/sec7,694 ops/sec
Koa21,110 ops/sec21,634 ops/sec20,264 ops/sec14,842 ops/sec
Express19,608 ops/sec20,044 ops/sec17,036 ops/sec10,588 ops/sec
Rune13,708 ops/sec15,068 ops/sec15,311 ops/sec8,930 ops/sec

Measured on GitHub Actions ubuntu-latest using 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

AdapterDescription
BunRune via @rune/adapter-bun (Bun.serve)
Node.jsRune via @rune/adapter-node (Node.js http)

Framework Adapters

Rune wrapped inside another framework via its adapter.

AdapterDescription
ElysiaRune via @rune/adapter-elysia
FastifyRune via @rune/adapter-fastify
KoaRune via @rune/adapter-koa
ExpressRune via @rune/adapter-express
HonoRune via @rune/adapter-hono
h3Rune via @rune/adapter-h3

Latest Adapter Results

Results from bun run bench:adapters (GET: 50,000 iterations, POST: 25,000 iterations, concurrency: 100):

AdapterGET /helloGET /user/:idGET /searchPOST /echo
Bun45,725 ops/sec44,032 ops/sec35,664 ops/sec5,519 ops/sec
Elysia43,632 ops/sec40,304 ops/sec32,651 ops/sec5,262 ops/sec
Node.js16,352 ops/sec16,429 ops/sec15,498 ops/sec9,056 ops/sec
Fastify16,215 ops/sec16,054 ops/sec13,471 ops/sec8,345 ops/sec
Koa14,403 ops/sec14,283 ops/sec13,621 ops/sec10,732 ops/sec
Express13,433 ops/sec13,791 ops/sec11,824 ops/sec10,656 ops/sec
h38,005 ops/sec8,031 ops/sec8,059 ops/sec4,676 ops/sec
Hono7,942 ops/sec7,963 ops/sec7,899 ops/sec4,468 ops/sec

Measured on the same machine under identical load. Results may vary by environment.

Running Benchmarks

Install Dependencies

Terminal window
bun install

Run All Benchmarks

Terminal window
bun run bench:all

Run Individual Framework Benchmarks

Terminal window
bun run bench:rune # Rune
bun run bench:hono # Hono
bun run bench:elysia # Elysia
bun run bench:fastify # Fastify
bun run bench:node # Node.js native HTTP
bun run bench:koa # Koa
bun run bench:express # Express

Run Additional Benchmarks

Terminal window
bun run bench:middleware # Middleware throughput
bun run bench:perf-middleware # Middleware microbenchmark
bun run bench:router # Router microbenchmark
bun run bench:query-param # Query param microbenchmark
bun run bench:event-bus # Event bus microbenchmark
bun run bench:graphql # GraphQL query execution
bun run bench:socket # Socket operations

Run Adapter Benchmarks

Terminal window
bun run bench:adapter-node # Rune via Node.js adapter
bun run bench:adapter-bun # Rune via Bun adapter
bun run bench:adapter-elysia # Rune via Elysia adapter
bun run bench:adapter-hono # Rune via Hono adapter
bun run bench:adapter-express # Rune via Express adapter
bun run bench:adapter-koa # Rune via Koa adapter
bun run bench:adapter-fastify # Rune via Fastify adapter
bun run bench:adapter-h3 # Rune via h3 adapter
bun run bench:adapters # All adapter benchmarks

Benchmark Configuration

Output Fields

FieldDescription
ops/secOperations per second
ms/opAverage 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

Terminal window
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 results

Notes

  • 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.md by the runner scripts