You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: Profile repeated CLI startup and packed-consumer setup in CI tests #234
Follow-up extracted from #185's existing profiling item. In verify run 35489862739, Windows core npm test took 4m56s and packed-package smoke took 56s, while core builds took 3–5 seconds each. Repeated CLI/project startup and consumer setup are candidates for investigation, not established causes of all elapsed time.
Profile process startup, project loading, fixture creation and registry/install work. Record representative per-test timings, then reuse safe fixtures or consolidate redundant setup while retaining process-isolation, CLI and fresh-installed-package coverage where those are the behavior under test. Preserve Windows and OS/Node coverage; assess sharding only after profiling. Distinguish runner execution from wall time and report measured before/after results. Coordinate with #202 rather than treating worker startup timeout as a proven performance-only issue. Priority: investigate.
Update the matching repository documentation with any behavior/workflow changes. Preserve required checks and deliberate reproducibility validation. No implementation or deployment changes were made by this audit.
Profiled on macOS 15 (darwin 25.6.0), Node 26.8.2, 12 cores, warm npm cache. Local numbers only — these do not establish Windows behavior, and the 4m56s in the issue is one CI run, not a controlled benchmark.
Method: intercepted every child_process entry point via a module.registerHooks resolve hook that redirects node:child_process to a timing shim, then ran the suite both whole-and-parallel and one file at a time, recording per-test durations and every child process.
Headline: repeated CLI startup is real but is not the dominant cost — a negative result on the leading hypothesis.
582 tests / 83 files. Sum of per-file solo runs: 188.6s. Parallel runner duration: 36–41s.
Tests spawn 326 child processes totalling 46.0s = 24% of the sequential total. 56 of 83 files spawn nothing at all and account for 76.7s (41%).
src/cli.ts is spawned 110 times. Measured startup floor: bare node 26 ms → src/cli.ts --help186 ms → routes --project starters/default 309 ms. The built dist/cli.js --help is 129 ms, so TypeScript stripping is only ~57 ms; the other ~160 ms is the module graph.
110 × 186 ms ≈ 20.5s, ~11% of the sequential total. Not nothing, but not the story — and those spawns are the behavior under test, so they stay.
Three of the four slowest files barely spawn: extensions 13.8s (1.6s children), compliance 12.0s (3.6s), prerender 11.0s (0.5s), explain 10.5s (1.8s), site 7.3s (zero children). extensions.test.ts is 29 tests at a ~200 ms in-process floor each — project loading/compilation inside the test process. That is where the remaining headroom is.
The packed-package smoke does one pack and one install (9.2s locally). No redundant setup to consolidate there; its CI cost is npm install + tsc on the runner filesystem.
One outlier justified a change:install.test.ts spent 11.2s of its 11.4s in child processes because six release() calls each re-ran scripts/build.ts + npm pack for byte-identical output (~8.7s). PR #239 builds and packs once per file and reuses the bytes. Each test still serves the freshly packed tarball over its own HTTP server and installs it via the real install.sh into its own prefix — no spawned-process or fresh-install coverage was converted to an in-process call, and no OS/Node matrix entry was touched.
Before/after, three runs each: install.test.ts alone 11.19/11.24/12.21s → 3.51/3.51/3.58s; full npm test runner duration 36.03/40.23/40.61s → 34.06/35.27/35.48s. The per-file figure is the reliable one; the parallel wall figure is noisy and the ranges overlap at the edges. (An earlier cold-dist/ first run measured 61.5s; excluded rather than used to claim a larger win.)
Sharding: assessed, not attempted. The suite is throughput-bound (longest file 13.8s vs 188.6s total), so it would help, but it is a CI-topology change that deserves its own Windows measurement rather than riding on this.
#202 is not folded in — nothing measured here establishes the Windows auth-store worker startup timeout as a performance-only issue.
Verified on macOS: npm run lint, npm run typecheck, npm run check, full npm test (581 pass, 1 skip, 0 fail). Windows not run.
Activity
jimhoyd commentedon Sep 20, 2026
Profiled on macOS 15 (darwin 25.6.0), Node 26.8.2, 12 cores, warm npm cache. Local numbers only — these do not establish Windows behavior, and the 4m56s in the issue is one CI run, not a controlled benchmark.
Method: intercepted every
child_processentry point via amodule.registerHooksresolve hook that redirectsnode:child_processto a timing shim, then ran the suite both whole-and-parallel and one file at a time, recording per-test durations and every child process.Headline: repeated CLI startup is real but is not the dominant cost — a negative result on the leading hypothesis.
src/cli.tsis spawned 110 times. Measured startup floor: bare node 26 ms →src/cli.ts --help186 ms →routes --project starters/default309 ms. The builtdist/cli.js --helpis 129 ms, so TypeScript stripping is only ~57 ms; the other ~160 ms is the module graph.Three of the four slowest files barely spawn: extensions 13.8s (1.6s children), compliance 12.0s (3.6s), prerender 11.0s (0.5s), explain 10.5s (1.8s), site 7.3s (zero children). extensions.test.ts is 29 tests at a ~200 ms in-process floor each — project loading/compilation inside the test process. That is where the remaining headroom is.
The packed-package smoke does one pack and one install (9.2s locally). No redundant setup to consolidate there; its CI cost is npm install + tsc on the runner filesystem.
One outlier justified a change:
install.test.tsspent 11.2s of its 11.4s in child processes because sixrelease()calls each re-ranscripts/build.ts+npm packfor byte-identical output (~8.7s). PR #239 builds and packs once per file and reuses the bytes. Each test still serves the freshly packed tarball over its own HTTP server and installs it via the realinstall.shinto its own prefix — no spawned-process or fresh-install coverage was converted to an in-process call, and no OS/Node matrix entry was touched.Before/after, three runs each:
install.test.tsalone 11.19/11.24/12.21s → 3.51/3.51/3.58s; fullnpm testrunner duration 36.03/40.23/40.61s → 34.06/35.27/35.48s. The per-file figure is the reliable one; the parallel wall figure is noisy and the ranges overlap at the edges. (An earlier cold-dist/first run measured 61.5s; excluded rather than used to claim a larger win.)Sharding: assessed, not attempted. The suite is throughput-bound (longest file 13.8s vs 188.6s total), so it would help, but it is a CI-topology change that deserves its own Windows measurement rather than riding on this.
#202 is not folded in — nothing measured here establishes the Windows auth-store worker startup timeout as a performance-only issue.
Verified on macOS:
npm run lint,npm run typecheck,npm run check, fullnpm test(581 pass, 1 skip, 0 fail). Windows not run.Build and pack the installer fixture once per file
Build and pack the installer fixture once per file (#239)