FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[ty] Speed-up find-references by using multithreading for cross-file searches by MichaReiser · Pull Request #25042 · astral-sh/ruff · GitHub

Repository navigation

[ty] Speed-up find-references by using multithreading for cross-file searches - #25042

Merged
MichaReiser merged 1 commit into
mainfrom
micha/find-references-parallelize
May 8, 2026
Merged

MichaReiser merged 1 commit into
mainfrom
micha/find-references-parallelize

Conversation

Copy link
Copy Markdown
Member

Summary

Cross-file find-references can be costly, because we need to read every file in the project.
To speed this up, run this on our thread pool.

Closes astral-sh/ty#1720

MichaReiser added performance Potential performance improvement server Related to the Ruff or ty LSP server labels May 8, 2026
astral-sh-bot Bot requested a review from dhruvmanila May 8, 2026 11:10
astral-sh-bot Bot added the ty The ty type checker label May 8, 2026
Comment thread crates/ty_ide/src/references.rs Outdated
}

// If the target text is found, do the more expensive semantic analysis
let references = if is_external_visible {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We now branch here on whether to run the more expensive "search in the entire file" or "only rename keyword arguments and parameters". This allows us to share the heavy lifting between both cases

MichaReiser force-pushed the micha/find-references-parallelize branch from a0cc978 to 2364a8b Compare May 8, 2026 15:27
MichaReiser force-pushed the micha/find-references-parallelize branch from 2364a8b to 31ba26a Compare May 8, 2026 15:37
MichaReiser merged commit c206abe into main May 8, 2026
49 checks passed
MichaReiser deleted the micha/find-references-parallelize branch May 8, 2026 15:48
carljm added a commit that referenced this pull request May 8, 2026
* main: (23 commits)
  Lazily initialize `UnionBuilder` when transforming a `Union` (#25050)
  [ty] Speed-up find-references by using multithreading for cross-file searches (#25042)
  Revert "[ty] Lazily initialize `UnionBuilder` when transforming a union type" (#25049)
  [ty] Make text-based find-references pre-filter identifier boundary aware (#25036)
  [ty] Fix cross-file find-references for keyword arguments (#25043)
  [ty] Include TypedDict type context when inferring mixed constructors (#25039)
  [ty] Include TypedDict type context when inferring string keys (#25037)
  [ty] Lazily initialize `UnionBuilder` when transforming a union type (#24929)
  [ty] Skip global search for references if identifier is not externally visible (#25033)
  [ty] Support narrowing on `__class__` checks (#24997)
  [ty] Bump ecosystem-analyzer (#25032)
  [ty] Include error context for overload consistency diagnostics (#24950)
  [ty] Check non-generic overload implementations (#24936)
  Filter overloads based on return type for ParamSpec mapping (#24769)
  [ty] Add versioned parameters for dataclass decorator (#25029)
  [ty] Project reachability constraints before narrowing (#24982)
  [ty] Emit folding ranges from the language server for multi-line block headers. (#24978)
  [ty] Allow ParamSpec specialization through unioned generic classes (#24826)
  [ty] Adjust start of block folding range to preserve visible header for character-precise LSP clients. (#24917)
  [ty] Use `as_i64` when comparing `IntLiteralType` instances (#25023)
  ...
thejchap pushed a commit to thejchap/ruff that referenced this pull request May 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Cache/parallelize find references

3 participants


Back | FazBrowse Home | New Git URL