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

Skip to content

[ty] Compact retained definition kinds#25610

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/compact-definition-kind
Jun 3, 2026
Merged

[ty] Compact retained definition kinds#25610
charliermarsh merged 1 commit into
mainfrom
charlie/compact-definition-kind

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Several common DefinitionKind variants retain separate references to child AST nodes even though their parent node already retains those children. Lambda parameter definitions also retain a usize index.

Retain parent nodes for annotated assignments, import-from submodules, for statements, comprehensions, and with items, recovering their child nodes through the parent when needed. Store lambda parameter indices as u32.

On oaiproto, this reduces retained memory by 1,175,760 bytes (0.289%).

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

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

@astral-sh-bot

astral-sh-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 41.84MB 41.65MB -0.43% (185.90kB) ⬇️
trio 104.96MB 104.60MB -0.34% (369.04kB) ⬇️
sphinx 249.93MB 249.19MB -0.30% (758.20kB) ⬇️
prefect 677.46MB 675.45MB -0.30% (2.02MB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
Definition 2.18MB 2.00MB -8.33% (185.90kB) ⬇️

trio

Name Old New Diff Outcome
Definition 4.33MB 3.97MB -8.33% (369.04kB) ⬇️

sphinx

Name Old New Diff Outcome
Definition 8.89MB 8.15MB -8.33% (758.20kB) ⬇️

prefect

Name Old New Diff Outcome
Definition 24.24MB 22.22MB -8.33% (2.02MB) ⬇️

@astral-sh-bot

astral-sh-bot Bot commented Jun 3, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@codspeed-hq

codspeed-hq Bot commented Jun 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 65 untouched benchmarks
⏩ 60 skipped benchmarks1


Comparing charlie/compact-definition-kind (8b69658) with main (7d747eb)

Open in CodSpeed

Footnotes

  1. 60 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@charliermarsh charliermarsh marked this pull request as ready for review June 3, 2026 19:43
@charliermarsh charliermarsh added the performance Potential performance improvement label Jun 3, 2026
@charliermarsh charliermarsh force-pushed the charlie/compact-definition-kind branch from 9316c41 to 8b69658 Compare June 3, 2026 19:44
@charliermarsh charliermarsh merged commit d14149d into main Jun 3, 2026
59 checks passed
@charliermarsh charliermarsh deleted the charlie/compact-definition-kind branch June 3, 2026 20:00
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