-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Domain: PerformanceReports of unusually slow behaviorReports of unusually slow behaviorExperimentation NeededSomeone needs to try this out to see what happensSomeone needs to try this out to see what happensFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestoneSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
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 behaviorReports of unusually slow behaviorExperimentation NeededSomeone needs to try this out to see what happensSomeone needs to try this out to see what happensFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestoneSuggestionAn idea for TypeScriptAn idea for TypeScript