Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Avoid path lookups when sorting same-file diagnostics#26257

Merged
MichaReiser merged 1 commit into
mainfrom
micha/avoid-diagnostic-sort-path-lookups
Jun 23, 2026
Merged

[ty] Avoid path lookups when sorting same-file diagnostics#26257
MichaReiser merged 1 commit into
mainfrom
micha/avoid-diagnostic-sort-path-lookups

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Jun 23, 2026

Copy link
Copy Markdown
Member

Skip database-backed path resolution when two diagnostics belong to the same file. Reading the file's path calls a salsa method, which adds a tracked read. While not expensive on its own, it gets expensive when comparing thousands of diagnostics.

@astral-sh-bot

astral-sh-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 30.72MB 30.72MB -0.02% (6.00kB) ⬇️
trio 77.43MB 77.42MB -0.01% (6.37kB) ⬇️
sphinx 193.04MB 193.03MB -0.00% (8.13kB) ⬇️
prefect 515.28MB 515.26MB -0.00% (15.50kB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
parsed_module 9.77MB 9.77MB -0.05% (5.47kB) ⬇️
check_file_impl 315.04kB 314.51kB -0.17% (540.00B) ⬇️

trio

Name Old New Diff Outcome
parsed_module 15.04MB 15.04MB -0.03% (4.91kB) ⬇️
check_file_impl 1.59MB 1.59MB -0.09% (1.45kB) ⬇️

sphinx

Name Old New Diff Outcome
check_file_impl 4.51MB 4.50MB -0.09% (4.30kB) ⬇️
parsed_module 18.37MB 18.36MB -0.02% (3.83kB) ⬇️

prefect

Name Old New Diff Outcome
check_file_impl 17.86MB 17.84MB -0.10% (17.96kB) ⬇️
parsed_module 19.36MB 19.36MB +0.01% (2.47kB) ⬇️

@astral-sh-bot

astral-sh-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@MichaReiser MichaReiser changed the title Avoid path lookups when sorting same-file diagnostics [ty] Avoid path lookups when sorting same-file diagnostics Jun 23, 2026
@MichaReiser MichaReiser added performance Potential performance improvement ty Multi-file analysis & type inference labels Jun 23, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser marked this pull request as ready for review June 23, 2026 06:01
@MichaReiser MichaReiser requested a review from a team as a code owner June 23, 2026 06:01
@astral-sh-bot astral-sh-bot Bot requested a review from charliermarsh June 23, 2026 06:01
@MichaReiser MichaReiser merged commit 55e9c40 into main Jun 23, 2026
60 checks passed
@MichaReiser MichaReiser deleted the micha/avoid-diagnostic-sort-path-lookups branch June 23, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Potential performance improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant