-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Reuse unchanged ambient declarations in incremental parsing #32849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse unchanged ambient declarations in incremental parsing #32849
Conversation
b13f83e
to
2e5bbc3
Compare
Note: not intended to go into 3.6.1 (RC or otherwise) |
Given this is a change to incremental parsing only, I don't expect to see any changes, but |
Heya @weswigham, I've started to run the perf test suite on this PR at 2e5bbc3. You can monitor the build here. It should now contribute to this PR's status checks. Update: The results are in! |
Oh no, failing incremental parser tests! They're almost assuredly in the "low-value" bucket that's skipped except on CI or when |
@weswigham Here they are:Comparison Report - master..32849
System
Hosts
Scenarios
|
@weswigham 9 !== 4‽ GASP! 😱 |
…t#32849) * Incrementally parse unchanged ambient declarations * Re-parse modifiers and decorators so as not to skip errors * Revert unnecessary change * Undo the test change that was changed 2 years ago
Turns out that ambient declarations were happily reused for several years, until two years ago we made
NodeFlags.Ambient
and put it inNodeFlags.ContextFlags
in #17831. Henceforth, the context flags on ambient declarations did not match the parsing context where the parser was attempting to reuse the node (parseListElement
), so we needlessly re-parsed.I’m doing this because for #32517, it’s very handy to have a cheap check on whether ambient module declarations and module augmentations have changed.