Skip to content

perf: lazy-load cli startup modules#86

Merged
vincentkoc merged 2 commits intomainfrom
vincentkoc-code/cli-startup-lazy-load
Mar 9, 2026
Merged

perf: lazy-load cli startup modules#86
vincentkoc merged 2 commits intomainfrom
vincentkoc-code/cli-startup-lazy-load

Conversation

@vincentkoc
Copy link
Member

Summary

  • lazy-load session, output, queue, and skillflag modules from cli-core instead of importing them eagerly at startup
  • add an early --version fast path before config and command graph setup
  • keep the change scoped to CLI startup so one-shot commands pay less module parse/load work

Notes

  • the build now code-splits the lazily imported session/output/queue code from dist/cli.js
  • spot checks after pnpm run build showed node dist/cli.js --version averaging about 180ms over warm runs in this worktree

Testing

  • pnpm exec tsc -p tsconfig.json --noEmit
  • pnpm test

@vincentkoc vincentkoc self-assigned this Mar 9, 2026
@vincentkoc vincentkoc marked this pull request as ready for review March 9, 2026 23:15
@vincentkoc vincentkoc merged commit 4a1e4eb into main Mar 9, 2026
1 check passed
@vincentkoc vincentkoc deleted the vincentkoc-code/cli-startup-lazy-load branch March 9, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant