[Transforms] Performance fixes#8824
Merged
Merged
Conversation
Contributor
Author
|
Ping |
| // Create an identifier and give it a parent. This allows us to resolve the react | ||
| // namespace during emit. | ||
| const react = createIdentifier(reactNamespace || "React"); | ||
| react.flags &= ~NodeFlags.Synthesized; |
Contributor
Contributor
Author
There was a problem hiding this comment.
No, this is a specific case to ensure the react namespace is properly resolved by the emit resolver, which would otherwise try to find an original source tree node that doesn't exist.
Contributor
|
👍 |
| * transformation. This ensures transient properties related to transformations can be safely | ||
| * stored on source tree nodes that may be reused across multiple transformations (such as | ||
| * with compile-on-save). | ||
| */ |
Member
There was a problem hiding this comment.
Can you comment on the lifetime of this transformId? You mentioned monotonically increasing but is that in a global context, or per compilation?
Member
There was a problem hiding this comment.
It sounds like global (you mentioned compile-on-save), but clarify this
Contributor
Author
There was a problem hiding this comment.
Yes, globally. I need to ensure that I can clean up transient properties from source tree nodes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses several performance issues in tree transformations. This includes:
tsnamespace in node.--extendedDiagnosticscompiler flag which dumps all of the performance marks and measures.NodeEmitFlagsand custom ranges for comments and source maps on the node.getNodeEmitFlagsto speed up repeated lookups.