ShopperCove
Menu
All writingBlogTopicsCategoriesAboutRSS
Blog
Categories
Observability & SRE62All categories
About

Plate 91

  1. Blog

Tinyexec vs execa: 2.7 KB vs 37 KB Gzip

Aditya Challa·5 October 2026·4 min read

Hands-on
On this page
  1. What I tested
  2. How wide was the size gap?
  3. How fast were the spawns?
  4. Which one should you pick?
  5. Sources
  6. Related

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.

What I tested

  • Machine: 8 vCPU Intel Xeon / 15 GB RAM shared Linux cloud box, tested 6 Oct 2026 about 01:09–01:11 IST.
  • Versions: tinyexec 1.3.1, execa 10.0.1, Node 22.20.0, esbuild 0.28.2 node ESM minify + gzip -9.
  • Fixture: /workspace/bench-tinyexec-execa/. Size entries import exec / execa and call echo hello. Speed: spawn true with empty args, 200 iters × 9 rounds (median) after warm; run twice. Parity check: echo hello-sc stdout matched.
  • Findings: gzip 2,664 B vs 37,004 B (about 13.9×). Run 1: 309.248 vs 420.115 ms for 200 spawns (1.55 vs 2.10 ms each, 1.36×). Run 2: 301.987 vs 415.143 ms (1.51 vs 2.08 ms each, 1.37×). Package disk about 27 KB vs 361 KB for the top-level folders.
  • One surprise: even on a no-op true spawn, execa paid a steady ~0.5 ms per call on this box, not only the 34 KB gzip gap.
  • Not tested: piping, concurrent maps, Windows .cmd resolution, AbortSignal cancel paths, zx-style scripts, Deno/Bun runtimes, or execa's full option surface beyond a simple argv spawn.

How wide was the size gap?

Build (esbuild node minify)Minifiedgzip -9
tinyexec6,051 B2,664 B
execa 10117,610 B37,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.

How fast were the spawns?

Path (200 calls, median of 9, cmd true)tinyexecexeca
run 1309.248 ms (1.55 ms/call)420.115 ms (2.10 ms/call)
run 2301.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.

Which one should you pick?

SituationMy pick
Tiny Vite/Rollup plugin that shells out oncetinyexec
New CLI where every KB of deps matterstinyexec
App already deep in execa helpers / pipingexeca
You need execa's richer option and error modelexeca
Bundle budget under about 5 KB gzip for spawntinyexec

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.

Sources

  • https://github.com/tinylibs/tinyexec
  • https://www.npmjs.com/package/tinyexec
  • https://github.com/sindresorhus/execa
  • https://www.npmjs.com/package/execa

Related

  • https://www.shoppercove.com/blog/size-limit-vs-bundlesize
  • https://www.shoppercove.com/blog/knip-vs-depcheck
  • https://www.shoppercove.com/blog/lefthook-vs-husky
  • https://www.shoppercove.com/blog/picocolors-vs-chalk
  • https://www.shoppercove.com/blog/pnpm-vs-npm-vs-bun
  • https://www.shoppercove.com/blog/oxlint-vs-eslint
  • https://www.shoppercove.com/blog/esbuild-register-vs-jiti
  • https://www.shoppercove.com/blog/tsup-vs-unbuild
tinyexecexecanode.jsbundle sizeperformanceprocess runnerclijavascript

Lab evidence

What I found running this

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.

Notes when a lab post goes up

Occasional email for new hands-on reviews. No sequence and no sponsors.

Related links

  • Plate 55

    Klona vs structuredClone: 1.4M vs 225k Clones per Second

    5 Oct 2026

  • Plate 35

    cookie-es vs cookie: 2.3 KB vs 1.4 KB Gzip

    5 Oct 2026

  • Plate 81

    scule vs change-case: 570 B vs 795 B Gzip

    5 Oct 2026

On this page

  1. What I tested
  2. How wide was the size gap?
  3. How fast were the spawns?
  4. Which one should you pick?
  5. Sources
  6. Related
All writingBlogCategoriesTopicsAboutPrivacyRSS

© 2026 ShopperCove