Skip to content

Skip CLI construction for version-only invocations#20505

Closed
charliermarsh wants to merge 1 commit into
mainfrom
charlie/codex-fast-version-flag
Closed

Skip CLI construction for version-only invocations#20505
charliermarsh wants to merge 1 commit into
mainfrom
charlie/codex-fast-version-flag

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Skip executable-path resolution and full Clap command construction for the version-only uv --version and uv -V invocations. All other argument combinations continue through the existing parser, and both spellings have integration snapshot coverage.

Measurements

Profiling binaries, one pinned CPU, 100 warmups, and 500 alternating pairs:

Command Before After Change (95% paired CI)
uv --version wall 9.15 ms 7.14 ms -21.8% [-22.2%, -21.3%]
uv --version CPU 8.41 ms 6.42 ms -23.6% [-24.0%, -23.3%]

The --help and representative basic-command controls were neutral, and output hashes matched.

Validation

  • cargo clippy --locked -p uv --lib --tests --features test-python,test-pypi -- -D warnings
  • cargo nextest run --locked -p uv --features test-python,test-pypi --test it -E 'test(version_flag)' --no-capture

@charliermarsh
charliermarsh force-pushed the charlie/codex-fast-version-flag branch from 783e7dd to bead6ff Compare July 17, 2026 23:54
@astral-sh-bot

astral-sh-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the main base revision.

  • Added tests: 1
  • Removed tests: 0
  • Changed suites: 1
uv::it: +1 / -0

Added:

  • uv::it::version::version_flag

Removed: none

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