Bunchee includes a benchmark harness that generates temporary TypeScript packages and invokes dist/bin/cli.js directly. This method avoids npx, network access, or package-manager startup overhead in measurements.
By default, the harness preserves output between runs to focus measurements on build work. To include the removal of previous output in the measurement, pass the --clean flag.
Each scenario validates expected files and records a SHA-256 digest of the complete output. The report provides metrics including median and p95 wall time, CPU time, maximum resident memory, JS and declaration graph time (which includes TypeScript Program setup), and output writes.
# Build Bunchee, then benchmark 1, 8, and 57-entry packages.
pnpm benchmark
# A quick smoke run.
pnpm benchmark -- --entries 1 --iterations 1 --warmup 0
# Include the larger worker-threshold fixture.
pnpm benchmark -- --entries 57,256 --iterations 10
# Preserve a JSON report without the preceding build command's output.
pnpm build
node ./scripts/benchmark.js --entries 57,256 --iterations 10 --json > benchmark.json