Skip to content
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

Pre-generate names ahead of time #23834

Merged
merged 1 commit into from
May 3, 2018
Merged

Pre-generate names ahead of time #23834

merged 1 commit into from
May 3, 2018

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented May 2, 2018

This change ensures that we pre-generate all names in a lexical scope before descending the tree. This allows us to ensure that generated names that must be preserved in nested scopes are allocated at the right time before traversing the tree. In addition to allowing us to remove the SkipNameGenerationScope flag for generated identifiers, this sets up some other future PRs that will need name generation to occur at an earlier time.

For most of our performance suite the performance cost is not statistically significant. However, there is a very small increase in emit time (over one second) for very large projects (though still not statistically significant compared to an average emit time of over one minute).

@rbuckton rbuckton requested review from weswigham and mhegazy May 2, 2018 20:58
Copy link
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the side effect that the var declarations are in order now (even if the initial uses can now be out-of-order).

@rbuckton rbuckton merged commit 88d5d6f into master May 3, 2018
@rbuckton rbuckton deleted the generateNamesEarlier branch May 3, 2018 00:52
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants