Performance Benchmarks
ZNTC compares transpile and bundle performance — and final bundle size (tree-shaking + minifier quality) — against esbuild, SWC, Bun, Rolldown, Rspack, and related tools.
Environment
Section titled “Environment”- Platform:
darwin arm64 - Baseline date: 2026-05-30
- CLI:
bench.ts, 50-run median, direct CLI binary execution without npx overhead - NAPI / WASM / CLI:
napi-bench.ts, 10 warmups + 100-run median - Bundle perf:
bundle-perf.ts, 5 warmups + 50-run median, CI-style same-run ZNTC/Rolldown/Rspack comparison - Cold build / incremental rebuild:
cold-build.ts/inprocess-rebuild.ts— 1→1000 synthetic modules plus a real dependency (lodash-es) compared against esbuild/rolldown via in-process programmatic APIs. Cold = cache-less initial full build (up to 1000 modules); incremental = pure rebuild with cache reuse (debounce/watch latency excluded, up to 100 modules — the 1000-module incremental case is watch-based and kept to cold only). - Pipeline:
pipeline.ts, 15-run median, profile total - Bundle size:
smoke.ts --minify-all, 2026-05-30, 9 real npm libraries bundled + minified, raw output bytes
For time charts, lower is faster (bar label = median wall time). For the bundle-size chart, lower is smaller (bar label = raw bytes).
How to Run
Section titled “How to Run”zig build -Doptimize=ReleaseFastzig build napizig build wasm
bun run tests/benchmark/bench.tsbun run tests/benchmark/napi-bench.tsbun run tests/benchmark/bundle-perf.ts --no-fail --output bundle-perf.jsonbun run tests/benchmark/pipeline.tsbun run tests/benchmark/cold-build.tsbun run tests/benchmark/inprocess-rebuild.ts
bun run tests/benchmark/smoke.ts --minify-all \ --filter=zod,effect,lodash-es,preact,immer,date-fns,rxjs,mobx,three \ --json=size.json