4 min read
I bundled process runners on this box: tinyexec 1.3.1 came in at 2,664 B gzip against execa 10.0.1 at 37,004 B. Spawning true 200 times (median of 9), tinyexec took about 1.55 ms per call and execa about 2.10 ms.
Short answer: pick tinyexec when a Vite plugin, test helper, or small CLI only needs argv + stdout/stderr without execa's full API. Pick execa when you already rely on its richer options, piping helpers, or the wider ecosystem around it. No affiliate links in this post.
| Build (esbuild node minify) | Minified | gzip -9 |
|---|---|---|
| tinyexec | 6,051 B | 2,664 B |
| execa 10 | 117,610 B | 37,004 B |
tinyexec was about 13.9× smaller gzip for a basic echo entry. Track shipped CLI weight with size-limit vs bundlesize. After a swap, prune unused imports with knip vs depcheck.
| Path (200 calls, median of 9, cmd true) | tinyexec | execa |
|---|---|---|
| run 1 | 309.248 ms (1.55 ms/call) | 420.115 ms (2.10 ms/call) |
| run 2 | 301.987 ms (1.51 ms/call) | 415.143 ms (2.08 ms/call) |
On this box tinyexec was about 1.36–1.37× faster on empty true spawns. Hook runners sit next to my lefthook vs husky notes when the question is process tooling around git, not HTTP clients.
| Situation | My pick |
|---|---|
| Tiny Vite/Rollup plugin that shells out once | tinyexec |
| New CLI where every KB of deps matters | tinyexec |
| App already deep in execa helpers / piping | execa |
| You need execa's richer option and error model | execa |
| Bundle budget under about 5 KB gzip for spawn | tinyexec |
Bottom line: tinyexec 1.3.1 shipped 2.7 KB gzip against execa 10.0.1 at 37 KB, and spawned true about 1.55 vs 2.10 ms per call. Who should not switch: teams with a large execa surface (pipes, templates, advanced signals) — rewrite cost beats a 34 KB gzip win. Cross-check package managers with pnpm vs npm vs Bun. Lint: oxlint vs ESLint.
How this was made: I installed tinyexec and execa on the ShopperCove box, measured esbuild minify+gzip sizes for node ESM entries, timed true spawns twice, checked echo stdout parity, and recorded the JSON. The write-up was drafted with AI help and checked against that output.
Lab evidence
Hands-on on ShopperCove box 6 Oct 2026 ~01:09-01:11 IST (8 vCPU Intel Xeon / 15 GB shared Linux, Node 22.20.0). tinyexec 1.3.1 vs execa 10.0.1, esbuild 0.28.2 node ESM minify + gzip -9. Fixture /workspace/bench-tinyexec-execa/: size entries import exec/execa and call echo hello; speed spawns true with empty args, 200 iters x 9 median after warm, run twice. Run 1: gzip 2,664 vs 37,004 B; 309.248 vs 420.115 ms (1.55 vs 2.10 ms/call). Run 2: 301.987 vs 415.143 ms (1.51 vs 2.08 ms/call). echo hello-sc stdout matched. Disk ~27 KB vs ~361 KB. Raw: res-bundle.json, res-speed-run1.json, res-speed-run2.json. Not tested: piping, Windows .cmd, AbortSignal, zx, Deno/Bun. No affiliate.