Swap closure state in the type-checker to var to avoid TDZ checks.#52835
Swap closure state in the type-checker to var to avoid TDZ checks.#52835DanielRosenwasser merged 2 commits intomainfrom
var to avoid TDZ checks.#52835Conversation
|
@typescript-bot perf test this faster |
|
Heya @DanielRosenwasser, I've started to run the abridged perf test suite on this PR at 99368d9. You can monitor the build here. Update: The results are in! |
var to avoid TDZ checks.var to avoid TDZ checks.
|
@DanielRosenwasser Here they are:Comparison Report - main..52835
System
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It's sort of interesting that it's always 0.10ish seconds saved; is there a fixed window where this is problematic? |
|
Ugh, probably conflating changes. @typescript-bot perf test this |
|
Heya @DanielRosenwasser, I've started to run the perf test suite on this PR at 99368d9. You can monitor the build here. |
|
GitHub has been 500'ing, so the perf run succeeded, but posting a comment didn't succeed. Here are the results:CompilerComparison Report - main..52835
System
Hosts
Scenarios
TSServerComparison Report - main..52835
System
Hosts
Scenarios
StartupComparison Report - main..52835
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The parser scanner change was a huge win for the few variables it modified, but this one is 10x less of a win for like 4x the variables changed (a few hundred); do we think it's worth it? |
|
Well, I guess xstate is consistently like 3%, and the server tests have good |
Definitely! I think it's very scoped, and the conceptual cleanliness buys us relatively little - so it's a free win to me. I could never argue with a developer using TypeScript that a 1-3% reduction in type-checking time wasn't worth it because we didn't want to disable our linter. So I think we should even do this across the compiler. The only thing that might be lacking is some documentation on why it is that we're doing this. |
| // Note: we only look at files already found by module resolution, | ||
| // so there may be files we did not consider. | ||
| const map = new Map<string, boolean>(); | ||
| var map = new Map<string, boolean>(); |
There was a problem hiding this comment.
| var map = new Map<string, boolean>(); | |
| const map = new Map<string, boolean>(); |
There was a problem hiding this comment.
Wait, why did you suggest reverting just this one back to const?
There was a problem hiding this comment.
It's not a top level variable and is only referenced once for this memoized call. There's no way it has any meaningful performance impact.
But, my suggestion wasn't merged anyway and it's not hurting anything either.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Follow-up from #52832.