Skip to content

perf(cli): bypass command imports for exact version - #1129

Merged
Brad-Edwards merged 1 commit into
devfrom
GOV-901-cli-version-fastpath-pr
Aug 13, 2026
Merged

perf(cli): bypass command imports for exact version#1129
Brad-Edwards merged 1 commit into
devfrom
GOV-901-cli-version-fastpath-pr

Conversation

@doublewhy

Copy link
Copy Markdown

Plain-language summary

  • Context: Package managers, deployment checks, and operators often run raes --version only to identify the installed release.
  • Problem: That simple request imported every CLI command and much of the compiler, solver, and conformance stack. On the measured reference machine it consumed about 1.1 seconds before printing one line.
  • Fix: Add a tiny console entry point that handles only the exact --version and -V argument forms from installed package metadata, then delegates every other invocation to the existing Typer application unchanged.

Issue closed

Closes #1111

What changed

  • Routes the raes console script through a narrow entry point.
  • Preserves installed-distribution metadata as the only version source.
  • Preserves the existing honest unknown fallback when package metadata is unavailable.
  • Leaves --help, subcommands, mixed arguments, and direct Typer invocation on the existing code path.
  • Adds source-tree and installed-wheel startup checks with relative and absolute performance budgets.

Verification

  • Focused CLI, packaging, and version tests: 53 passed, 19 deselected.
  • Installed/startup integration check: 1 passed.
  • Entry point and CLI main coverage: 33/33 statements, 4/4 branches.
  • Ruff and repository policy pass.
  • Rebuilt on current dev at 3d6e369b726607ff657a841c7f1dee0bec655b8f.

Scope

This intentionally optimizes only exact version requests. Lazy-loading the full help/command tree and changing schema-bundle copy semantics are separate, more invasive performance projects.

@doublewhy
doublewhy marked this pull request as ready for review August 12, 2026 20:39
@Brad-Edwards
Brad-Edwards merged commit 3cd0f49 into dev Aug 13, 2026
17 of 19 checks passed
@Brad-Edwards
Brad-Edwards deleted the GOV-901-cli-version-fastpath-pr branch August 13, 2026 02:56
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.

2 participants