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

Skip to content

[ty] Compact retained definition inference extras#25838

Merged
charliermarsh merged 4 commits into
mainfrom
charlie/compact-definition-inference-extras
Jun 12, 2026
Merged

[ty] Compact retained definition inference extras#25838
charliermarsh merged 4 commits into
mainfrom
charlie/compact-definition-inference-extras

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Most retained DefinitionInference values need only one or two fields from DefinitionInferenceExtra, but currently allocate the full structure.

This specializes the common shapes into compact enum variants and keeps the existing structure as a fallback for uncommon combinations. Based on the measured shape distribution, this is expected to reduce retained memory by about 789 MB, or 0.78%, on the large-repository workload used for this investigation.

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

astral-sh-bot Bot commented Jun 10, 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.36%. The percentage of expected errors that received a diagnostic held steady at 88.82%. The number of fully passing files held steady at 93/134.

@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 34.83MB 34.63MB -0.58% (205.43kB) ⬇️
trio 85.97MB 85.02MB -1.10% (971.09kB) ⬇️
sphinx 202.30MB 200.45MB -0.91% (1.84MB) ⬇️
prefect 550.41MB 545.78MB -0.84% (4.63MB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
infer_definition_types 1.55MB 1.35MB -12.87% (204.67kB) ⬇️
infer_deferred_types 446.48kB 445.72kB -0.17% (776.00B) ⬇️

trio

Name Old New Diff Outcome
infer_definition_types 6.54MB 5.60MB -14.43% (966.18kB) ⬇️
infer_deferred_types 1.80MB 1.80MB -0.27% (4.91kB) ⬇️

sphinx

Name Old New Diff Outcome
infer_definition_types 20.47MB 18.63MB -8.96% (1.83MB) ⬇️
infer_deferred_types 4.04MB 4.03MB -0.24% (10.05kB) ⬇️

prefect

Name Old New Diff Outcome
infer_definition_types 74.55MB 70.17MB -5.88% (4.38MB) ⬇️
infer_deferred_types 9.09MB 8.84MB -2.78% (259.25kB) ⬇️

@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@charliermarsh charliermarsh force-pushed the charlie/compact-definition-inference-extras branch 2 times, most recently from e109b9b to 48e2290 Compare June 12, 2026 01:20
@charliermarsh charliermarsh force-pushed the charlie/compact-definition-inference-extras branch from 9d19b70 to 93a641b Compare June 12, 2026 02:04
@charliermarsh charliermarsh marked this pull request as ready for review June 12, 2026 02:51
@charliermarsh charliermarsh merged commit a4fc9e6 into main Jun 12, 2026
93 of 94 checks passed
@charliermarsh charliermarsh deleted the charlie/compact-definition-inference-extras branch June 12, 2026 02:51
@charliermarsh charliermarsh added the performance Potential performance improvement label Jun 12, 2026
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