Move const enums and typeof facts maps out of createTypeChecker#32691
Conversation
|
@typescript-bot perf test this I don't expect a significant change in performance here, as our perf tests run benchmarks against the command line compiler which will only really call |
|
Heya @rbuckton, I've started to run the perf test suite on this PR at 909dfbb. You can monitor the build here. It should now contribute to this PR's status checks. Update: The results are in! |
|
@rbuckton Here they are:Comparison Report - master..32691
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Benchmark failed because of |
|
Yeah, Bind time is such a small portion of total time that the slightest blip can trigger the check to fail. I need to change the benchmark to only fail if total time exceeds a threshold. |
We have
--preserveConstEnumsenabled for the compiler to better support our API consumers, however that means we always preserve const enums, even in places where they would be otherwise unreachable as an API consumer. This means that every time we callcreateTypeCheckerfrom the language service, we are re-evaluating these unused declarations for const enums, which is unnecessary overhead.This PR moves the various const enums as well as
typeofEQFactsandtypeofNEFacts(which are read-only maps) out ofcreateTypeCheckerto reduce overhead.