Skip to content

perf: speed up shell completion - #144

Merged
D3f0 merged 3 commits into
mainfrom
issue-143-completion-speed
Sep 28, 2026
Merged

D3f0 merged 3 commits into
mainfrom
issue-143-completion-speed

Conversation

@D3f0

@D3f0 D3f0 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • lazy-load Copier only when create.package executes
  • add INVOKE_COMPLETION_DISABLE_PLUGINS=1 to skip installed collection plugins during shell completion
  • preserve project/local tasks, built-in -x completions, default plugin completion, and non-completion plugin loading
  • document the behavior and add subprocess-level regression coverage

Performance

Measured over 20 real completion subprocesses in the development environment:

Command Median
main: intk --complete -- intk -x xxx 486.1 ms
branch: same completion 460.7 ms
branch with INVOKE_COMPLETION_DISABLE_PLUGINS=1 314.3 ms

The lazy Copier regression also verifies that copier is absent from sys.modules after built-in completion.

Verification

  • uv run nox: Python 3.11, 3.12, 3.13, and 3.14 sessions pass; each reports 768 passed and 18 skipped
  • focused completion/Create tests: 10 passed
  • Ruff checks and formatting: pass on changed files
  • Pylint: 10.00/10 on changed Python files
  • reviewer: no Critical, Important, or Minor findings

pyright src/invoke_toolkit and ty check src/invoke_toolkit still report pre-existing repository-wide typing errors unrelated to this diff.

Closes #143

@D3f0
D3f0 force-pushed the issue-143-completion-speed branch from c788f60 to 067d925 Compare September 28, 2026 10:20
@D3f0
D3f0 merged commit 50a1f37 into main Sep 28, 2026
4 checks passed
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.

perf: reduce shell completion startup cost

1 participant