Skip to content

Experiment with tracking which entities actually may be narrowed #51525

Open
@DanielRosenwasser

Description

@DanielRosenwasser

In Pyright, narrowing can be avoided by keeping track of which entities actually get narrowed within a given scope. This could save a good amount of time by avoiding redundant walks up the control flow graph just to discover nothing interesting a given variable or property.

I'm not sure if Pyright also tracks the first location at which an entity may be narrowed, but that information could also be used to signal when a narrowing walk needs to stop.

This would come at the cost of some memory overhead, but we'd need to experiment to see what the trade-offs are.

Metadata

Metadata

Assignees

Labels

Domain: PerformanceReports of unusually slow behaviorExperimentation NeededSomeone needs to try this out to see what happensFix AvailableA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions