Skip to content

03Concepts

Benchmarks

Compiler timings and memory by specification size, and bundle sizes, measured on every build.

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.

Median of 5 runs after a warm-up, compiled in memory (writing excluded).
OperationsModelsSpecParseAnalyzeGenerateTotalFilesHeap
100620.06 MB19 ms5 ms38 ms63 ms17125.5 MB
5003020.30 MB69 ms18 ms152 ms246 ms81190.6 MB
2,5001,5021.5 MB295 ms81 ms649 ms1,038 ms4,011127.7 MB
10,0006,0026.0 MB1,165 ms318 ms2,303 ms3,805 ms16,011409.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.

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.

A client of 1,000 operations and 602 models; minified, not gzipped.
BundleSize
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.

Terminal window
pnpm bench # the compiler benchmark
pnpm vitest run tests/integration/treeshake # writes tests/.output/treeshake/sizes.json
pnpm --filter swaggerz-website run data --measure # both, for the site