03Concepts
Benchmarks
Compiler timings and memory by specification size, and bundle sizes, measured on every build.
Compiler
Section titled “Compiler”scripts/bench.ts generates synthetic OpenAPI 3.0 specifications of increasing size and compiles each in memory. Each resource group adds five CRUD operations and three models, and every model references the previous group’s model, so the reference graph is unusually deep: a deliberately pessimistic case for dependency analysis.
“Total” covers loading, parsing, reference resolution, normalization, analysis and generating every file; writing to disk is excluded. “Heap” is the largest heap observed across the runs.
| Operations | Models | Spec | Parse | Analyze | Generate | Total | Files | Heap |
|---|---|---|---|---|---|---|---|---|
| 100 | 62 | 0.06 MB | 19 ms | 5 ms | 38 ms | 63 ms | 171 | 25.5 MB |
| 500 | 302 | 0.30 MB | 69 ms | 18 ms | 152 ms | 246 ms | 811 | 90.6 MB |
| 2,500 | 1,502 | 1.5 MB | 295 ms | 81 ms | 649 ms | 1,038 ms | 4,011 | 127.7 MB |
| 10,000 | 6,002 | 6.0 MB | 1,165 ms | 318 ms | 2,303 ms | 3,805 ms | 16,011 | 409.0 MB |
Measured on 25 October 2026, AMD EPYC 7763 64-Core Processor, Node.js 24.21.0, Linux (x64), at 7dbced4.
Time and memory grow linearly with the size of the specification. Regeneration only writes files whose content changed, so an incremental run touches a handful of files whatever the size.
Bundle size
Section titled “Bundle size”The tree-shaking test bundles small applications against a generated client and records their sizes. Tree-shaking explains how the client is built for it.
| Bundle | Size |
|---|---|
| 1 operation, direct module import (esbuild) | 16.1 kB |
| 3 operations through the barrel (esbuild) | 16.5 kB |
| 3 operations through the barrel (Vite production build) | 21.4 kB |
| 3 operations through the barrel (webpack production build) | 16.7 kB |
| 3 operations through the barrel (Rollup, not minified) | 51.0 kB |
| 1 React Query hook, without TanStack Query itself (esbuild) | 16.6 kB |
| The whole client (esbuild) | 336.7 kB |
Measured on 25 October 2026, AMD EPYC 7763 64-Core Processor, Node.js 24.21.0, Linux (x64), at 7dbced4.
Reproducing
Section titled “Reproducing”pnpm bench # the compiler benchmarkpnpm vitest run tests/integration/treeshake # writes tests/.output/treeshake/sizes.jsonpnpm --filter swaggerz-website run data --measure # both, for the site