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

Skip to content

[ty] Compact use-def binding interner keys#26193

Merged
charliermarsh merged 2 commits into
astral-sh:mainfrom
MichaReiser:micha/compact-place-state-bindings-index
Jun 22, 2026
Merged

[ty] Compact use-def binding interner keys#26193
charliermarsh merged 2 commits into
astral-sh:mainfrom
MichaReiser:micha/compact-place-state-bindings-index

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Jun 21, 2026

Copy link
Copy Markdown
Member

Store compact IDs in the use-def bindings reverse index instead of cloning complete Bindings values as hash-map keys.

This reduces allocations by 4.7 MB on attrs, 8.1 MB on Flake8, and 12.5 MB on AnyIO with neutral timing. Walltime benchmarks improve by 1-2%.

The main downside is that this introduces a HashTable where changing Bindings requires updating the manual hash function

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Jun 21, 2026
@astral-sh-bot

astral-sh-bot Bot commented Jun 21, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 94.37%. The percentage of expected errors that received a diagnostic held steady at 89.00%. The number of fully passing files held steady at 94/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 21, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 21, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@MichaReiser MichaReiser added the performance Potential performance improvement label Jun 22, 2026
@MichaReiser MichaReiser marked this pull request as ready for review June 22, 2026 16:37
@MichaReiser MichaReiser requested a review from a team as a code owner June 22, 2026 16:37
@astral-sh-bot astral-sh-bot Bot requested a review from charliermarsh June 22, 2026 16:37
@charliermarsh charliermarsh merged commit e2ea0bb into astral-sh:main Jun 22, 2026
60 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 ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants