Skip to content

Reuse computed type of condition expressions#49881

Merged
weswigham merged 1 commit intomicrosoft:mainfrom
JoostK:perf/recursive-function-checks
Aug 27, 2022
Merged

Reuse computed type of condition expressions#49881
weswigham merged 1 commit intomicrosoft:mainfrom
JoostK:perf/recursive-function-checks

Conversation

@JoostK
Copy link
Contributor

@JoostK JoostK commented Jul 12, 2022

Fixes #49845

This change threads the computed type of conditional expressions into checkTestingKnownTruthyCallableOrAwaitableType to avoid recursively revisiting expression subtrees, resulting in an exponential performance drop. The changed code is similar to how it was before #42835.

The test case used to run in ~13s on my laptop before the fix, and now completes instantly again (check time reported as 0.00s)

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

TypeScript 4.7.4: Exponential behavior in strict type checking

7 participants