HTTP framework benchmark harness for MiiaJS and comparative frameworks (Hono, Elysia, Fastify, NestJS, plus raw runtime baselines for Bun/Node/Deno).
- Bun (the harness runs via
bun run) - Node.js ≥ 22.22.1 (used to spawn some servers via
tsx)
bun run use:local # see "Dependency modes" below — required until @miiajs/* are on npm
bun install
bun run benchThe bench command launches an interactive CLI that lets you pick scenarios (get, post, get-api, post-api), frameworks, runtimes, and number of passes. Results are written to ./tmp/benchmarks/<type>/<scenario>_<timestamp>.txt and printed to the console.
The @miiajs/* packages can be resolved from two places. The project keeps a single package.json as source of truth (with ^0.1.0 semver) and toggles a local overrides field via a small script.
| Mode | Command | Resolves @miiajs/* from |
When to use |
|---|---|---|---|
| npm | bun run use:npm |
npm registry (^0.1.0) |
Default after publish; reproducible, no sibling checkout needed. |
| local | bun run use:local |
file:../miia/packages/<name> (sibling checkout) |
Iterating on miia source — edit miia, bun run build there, re-run bench. |
Both scripts also run bun install afterwards to update the lockfile.
use:local mutates package.json — it adds an overrides field pointing at the sibling ../miia checkout. You'll see the mutation in git status during dev sessions; do not commit it. Switch back with use:npm before committing other changes.
- Clone
miiaas a sibling:/parent/miiaand/parent/benchmarksboth exist. - In
../miia:bun install && bun run build(rebuild after any source change you want to benchmark). - In this repo:
bun run use:local && bun run bench. - To see which version is actually loaded, the benchmark banner prints e.g.
@miiajs/core@0.1.0 [local -> /parent/miia/packages/core]on startup.
Bun installs file: packages as per-file symlinks into ../miia/packages/<name>, so editing miia source and running bun run build there updates the linked dist/ files in place — no reinstall between iterations. Two caveats:
- New files in
dist/(e.g. a new export added after the lastbun installhere) are not auto-linked. If miia gains a brand-new exported module, runbun run use:localagain to refresh the links. - New runtime dependencies in
@miiajs/*requirebun installin../miiafirst, then re-run the benchmark.
@miiajs/core, @miiajs/node-server, and @miiajs/uws-server are not yet published on npm (v0.1.0 is in preparation). Until they are:
bun run use:npmleavespackage.jsonclean, but the subsequentbun installwill fail with 404 on@miiajs/core. This is expected — not a bug.- Use
bun run use:localas the only working mode.
After publish, bun run use:npm will "just work" and the default bun install on a fresh clone will resolve everything from the registry.
Benchmark results are written to ./tmp/benchmarks/<type>/<scenario>_<timestamp>.txt, where <type> is synthetic or realistic depending on the scenario. The tmp/ directory is gitignored.