Repository navigation
perf(cli): defer scan imports for version output - #876
Conversation
Partially address NVIDIA#865 with a lightweight Typer entry point. Reuse the existing command definitions and root callback so eager version options finish without loading scanner or provider implementations. Keep static scanning on the existing workflow. Add subprocess import guards and CLI parsing parity coverage. Signed-off-by: Whj9283 <1621370123@qq.com>
|
CI failed only on the six existing binary-structure timing assertions tracked in #861; the same six fail on main (baseline run). All 21 new entry-point tests passed (PR run). Keeping this PR scoped to version-query startup; #862 addresses the timing guard separately. |
Signed-off-by: Whj9283 <1621370123@qq.com>
|
Merged current main d7338f5 into this branch in signed commit 2e667a3, incorporating #862 without rewriting history. The PR remains limited to console version-query startup; no additional production behavior changes. Validation on this head: 15,421 offline tests passed, 14 skipped, 250 deselected, 4 expected failures. All nine binary-structure cases also passed separately with coverage enabled. CLI selection (460 tests), repository lint/format, entry-module mypy, wheel build and six installed-wheel version/import guards passed; wheel guards reused locked development dependencies. No live-provider tests run. Hosted CI is pending. |
rng1995
left a comment
There was a problem hiding this comment.
[SkillSpector Review]
Value and readiness
The installed console entry point can answer --version without importing scanner/provider implementations. Other commands reuse the actual Typer command definitions after lazy loading. I found no required code change at 2e667a3f22b375876b368db4907b89946757272b.
Material findings
No required change found. The lightweight app has the same root callback/options, and _LazyCommandGroup resolves commands through the existing implementation app rather than duplicating option schemas. The compatibility reexports preserve callers of cli.main/version_callback. Fresh-process import guards and parser parity cover root flags, invalid options, typos, and subcommand help.
PIC tradeoffs
The change deliberately retains the normal scanner workflow for scans; it improves version startup only.
Verification and gaps
Read the full five-file diff and pinned source/tests, description, and automated quota notices. The tests discover the configured console entry point from pyproject.toml and compare parser outputs. All six hosted checks succeeded. Static review only; I did not execute contributor code.
Scope
Partial contribution to #865 — intentionally does not close the issue.
Only the installed console script (
skillspector --version/-v) is optimized. Static--no-llmscans, help commands, and direct imports ofskillspector.clistill load the existing implementation; provider/constant import restructuring remains out of scope.Change
skillspector.cliapp and exports available.Validation
Local Python 3.12/macOS, five alternating fresh-process runs: median version-query wall time 1.1068s → 0.1204s. This is a local measurement, not a timing assertion or a claim about static-scan speed.