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

Skip to content

[ty] Short-circuit terminal narrowing constraints#26215

Merged
MichaReiser merged 2 commits into
mainfrom
micha/avoid-caching-terminal-narrowing-constraints
Jun 22, 2026
Merged

[ty] Short-circuit terminal narrowing constraints#26215
MichaReiser merged 2 commits into
mainfrom
micha/avoid-caching-terminal-narrowing-constraints

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Jun 22, 2026

Copy link
Copy Markdown
Member

Short-circuit in narrow_type_by_constraint and avoid caching terminal nodes, as they're trivial to solve.

Small 1% perf improvement, reduces overall allocations

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

astral-sh-bot Bot commented Jun 22, 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 22, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@MichaReiser MichaReiser reopened this Jun 22, 2026
@MichaReiser MichaReiser added the performance Potential performance improvement label Jun 22, 2026
@MichaReiser MichaReiser changed the title [ty] Avoid caching terminal narrowing constraints [ty] Short-circuit terminal narrowing constraints Jun 22, 2026
db,
base_ty,
graph: &projector.graph,
joins: projector.graph.joins(projected_root),

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.

short circuiting allows avoiding the allocation in joins

@MichaReiser MichaReiser requested a review from dcreager June 22, 2026 12:07
@MichaReiser MichaReiser marked this pull request as ready for review June 22, 2026 12:07
@MichaReiser MichaReiser requested a review from a team as a code owner June 22, 2026 12:07
@MichaReiser MichaReiser merged commit f3600f0 into main Jun 22, 2026
82 of 109 checks passed
@MichaReiser MichaReiser deleted the micha/avoid-caching-terminal-narrowing-constraints branch June 22, 2026 13:37
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