Skip to content

perf(cli): bundle runtime entries to reduce Windows startup I/O - #1996

Merged
N0zoM1z0 merged 3 commits into
mainfrom
perf/cli-startup-1685-20261012
Oct 12, 2026
Merged

N0zoM1z0 merged 3 commits into
mainfrom
perf/cli-startup-1685-20261012

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

The Windows dispatcher still loads the CLI module graph file by file. Bundle the CLI, output helpers and MCP doctor separately from MCP, while preserving original module URLs, lazy imports and worker files. Keep release metadata in its shared owning module so CLI, MCP, workers and package updates read the same version. Lazy CLI facades retain their source scope and named exports.

On Windows x64 / Node 24.18, two unprofiled observations per input on the same 89f5e489 source gave:

Public CLI input Original Bundled
24.6 KB native Evidence 17.98–19.50 s 6.80–12.02 s
16.17 MB native Evidence 19.32–20.78 s 13.11–13.13 s

Each call used a fresh Node process, shared locked dependencies, two CPUs and BelowNormal priority. Order was counterbalanced; OS caches and host activity were uncontrolled. Separate CPU profiles analyzed with Flameox show module-stat/lstat sample share moving from 70.2% to 54.0%. All self sample weights were checked against raw V8 data; the candidate's inclusive table remains partial at the provider cap.

The package grows by about 1.12 MB compressed because original worker files remain shipped. The JSON/JSONL regression test now uses the documented comma slice and asserts a nonempty projection independently.

Validation at c992f1f7 (main e19879328): build, 18 focused tests, typecheck/lint, docs and normal packaging pass. All 1,392 archive files match source and the fresh Windows installation. Native Windows Evidence views, real JavaScript workers, nonempty filtered JSONL, MCP doctor and default-timeout stdio MCP pass; all 172 tools have valid schemas, text/structured parity and a working following ping. These archive installs reuse existing locked production dependencies. The installed-package verifier also passes, including real npm update through a local release registry, setup/uninstall and cleanup. All 31 exact-head CI checks pass, including the Linux, macOS and Windows package baselines.

Refs #1065, #1685.

N0zoM1z0 and others added 3 commits October 12, 2026 07:28
Keep CLI and MCP bundles separate, preserve original module URLs and worker entrypoints, and share CLI output identities across bundled entries. Use a nonempty projection oracle with the documented filter slice grammar.

Co-authored-by: Kaoru0822 <[email protected]>
Keep the owning metadata module external and retain identifiable lazy CLI facades for startup and cancellation checks.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0
N0zoM1z0 marked this pull request as ready for review October 12, 2026 01:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T01:15:59.682195Z c992f1f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@N0zoM1z0
N0zoM1z0 merged commit d93fbda into main Oct 12, 2026
31 checks passed
@N0zoM1z0
N0zoM1z0 deleted the perf/cli-startup-1685-20261012 branch October 12, 2026 01:25
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
@morluto morluto added performance Performance regressions, scaling limits, and bounded-resource work area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the area: cli CLI adapter and one-shot commands label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants