Summary
runCommand runs checkStellarCliVersion() before every stellar invocation unless skipStellarVersionCheck is set (packages/core/src/shell/run-command.ts:27-29). checkStellarCliVersion (packages/core/src/stellar-cli/check-stellar-cli-version.ts:42-44) then runs probeMissingStellarCliFeatures, which spawns 3 more stellar <subcommand> --help probes (probe-stellar-cli-features.ts:30-38). There is no memoization, and checkBinary (packages/core/src/shell/check-binary.ts) does not set skipStellarVersionCheck, so the cascade triggers again from deploy-contract.ts:63, upload-wasm.ts:36, etc. A single ctg deploy ends up spawning ~10 subprocesses (version + 3 probes, sometimes twice) plus git/rustc metadata calls from artifacts/metadata.ts:15-34.
Why it matters
Every command pays a 5-10x subprocess tax that dominates wall-clock time, and the version check is re-run per subprocess instead of once per process.
Suggested fix
- Memoize
checkStellarCliVersion results per process (keyed by cwd, invalidated only if the binary changes)
- Have
checkBinary use skipStellarVersionCheck: true, since the actual command run right after will validate anyway
- Consider caching the probed features for the process lifetime
Priority: High | Release impact: Patch | Breaking: No
Summary
runCommandrunscheckStellarCliVersion()before everystellarinvocation unlessskipStellarVersionCheckis set (packages/core/src/shell/run-command.ts:27-29).checkStellarCliVersion(packages/core/src/stellar-cli/check-stellar-cli-version.ts:42-44) then runsprobeMissingStellarCliFeatures, which spawns 3 morestellar <subcommand> --helpprobes (probe-stellar-cli-features.ts:30-38). There is no memoization, andcheckBinary(packages/core/src/shell/check-binary.ts) does not setskipStellarVersionCheck, so the cascade triggers again fromdeploy-contract.ts:63,upload-wasm.ts:36, etc. A singlectg deployends up spawning ~10 subprocesses (version + 3 probes, sometimes twice) plusgit/rustcmetadata calls fromartifacts/metadata.ts:15-34.Why it matters
Every command pays a 5-10x subprocess tax that dominates wall-clock time, and the version check is re-run per subprocess instead of once per process.
Suggested fix
checkStellarCliVersionresults per process (keyed by cwd, invalidated only if the binary changes)checkBinaryuseskipStellarVersionCheck: true, since the actual command run right after will validate anywayPriority: High | Release impact: Patch | Breaking: No