Skip to content

[ty] Improve importer performance - #27159

Merged
MichaReiser merged 1 commit into
astral-sh:mainfrom
perfloop-oss:perfloop-pr-open-vfd527y7k1
Jul 24, 2026
Merged

MichaReiser merged 1 commit into
astral-sh:mainfrom
perfloop-oss:perfloop-pr-open-vfd527y7k1

Conversation

@perfloop-agent

Copy link
Copy Markdown
Contributor

Summary

On Linux x86_64, the median aggregate request-time measurement for three cached auto-import completion workloads fell from 3,514,303 ns/request to 3,007,003 ns/request (14.4%). The workloads use 64 completion candidates with 64 in-scope members, 256 candidates with 256 members, and 512 candidates with 1,024 members.

Completion count was unchanged (median 859 → 859, 10 samples per arm).

Change

Updates the scope-member lookup in crates/ty_ide/src/importer.rs for the auto-import completion path.

Test Plan

  • cargo test -p ty_ide auto_import_
  • The repository completion CLI returned 521 completions for the large auto-import workload.

Limitations

The timing result is an aggregate cached-completion measurement across the three listed workloads, not separate timing results for each workload. It does not measure cold requests, arbitrary workspace layouts, end-to-end editor latency, or platforms other than Linux x86_64.

Full measured evidence: https://app.perfloop.ai/t/oss/case_ydxbe2gn1p

@perfloop-agent
perfloop-agent requested a review from a team as a code owner July 24, 2026 13:40
@astral-sh-bot
astral-sh-bot Bot requested a review from lerebear July 24, 2026 13:40
@astral-sh-bot astral-sh-bot Bot added server Related to the Ruff or ty LSP server ty The ty type checker labels Jul 24, 2026
@AlexWaygood AlexWaygood added the performance Potential performance improvement label Jul 24, 2026
@MichaReiser MichaReiser changed the title [ty] Speed up cached auto-import completions on Linux x86_64 [ty] Improve importer performance Jul 24, 2026
@MichaReiser
MichaReiser merged commit 660edc0 into astral-sh:main Jul 24, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Potential performance improvement server Related to the Ruff or ty LSP server ty The ty type checker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants