Skip to content

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.

  • 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).

Terminal window
zig build -Doptimize=ReleaseFast
zig build napi
zig build wasm
bun run tests/benchmark/bench.ts
bun run tests/benchmark/napi-bench.ts
bun run tests/benchmark/bundle-perf.ts --no-fail --output bundle-perf.json
bun run tests/benchmark/pipeline.ts
bun run tests/benchmark/cold-build.ts
bun 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