Skip to content

Optimize parsing#19976

Merged
ahejlsberg merged 8 commits intomasterfrom
optimizeParser
Nov 16, 2017
Merged

Optimize parsing#19976
ahejlsberg merged 8 commits intomasterfrom
optimizeParser

Conversation

@ahejlsberg
Copy link
Copy Markdown
Member

@ahejlsberg ahejlsberg commented Nov 13, 2017

This PR optimizes our handling of JSDoc comment parsing resulting in parse time improvements of 6-7%. Previously, on every AST node where a JSDoc comment could occur we would always re-scan the whitespace preceding the node during finalization of the node object. Now, the scanner provides a flag to indicate if any JSDoc comments precede the current node, and we use this information to only process JSDoc comments when they are actually present.

@ahejlsberg
Copy link
Copy Markdown
Member Author

Note that #19979 broke parsing of arrow functions in one case. See here:

https://github.com/Microsoft/TypeScript/pull/19979/files#diff-5158944ac4103f3398a8f41ae0139069

The commit above to improve lookahead for arrow functions fixes this.

@ahejlsberg
Copy link
Copy Markdown
Member Author

@mhegazy I'd like to merge this one, so take a look when you can. Other than the 6-7% improvement it contains a fix to a regression. See above.

@ahejlsberg ahejlsberg merged commit b6f9605 into master Nov 16, 2017
@ahejlsberg ahejlsberg deleted the optimizeParser branch November 16, 2017 18:19
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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.

2 participants