Skip to content

Pre-generate names ahead of time#23834

Merged
rbuckton merged 1 commit into
masterfrom
generateNamesEarlier
May 3, 2018
Merged

Pre-generate names ahead of time#23834
rbuckton merged 1 commit into
masterfrom
generateNamesEarlier

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

@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 mhegazy and weswigham May 2, 2018 20:58
Copy link
Copy Markdown
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