Skip to content

[Parser] Optimize syntactic parsing for libSyntax #21955

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

Merged
merged 4 commits into from
Jan 18, 2019

Conversation

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Jan 17, 2019

Optimize syntactic parsing that is done for libSyntax/SwiftSyntax. The cumulative effect of the optimizations is a 1.6x speed-up.

Introduce ParsedTrivia which is a more efficient structure to use during lexing than syntax::Trivia.
This eliminates the overhead of ParsedRawSyntaxNode needing to do memory management.
If ParsedRawSyntaxNode needs to point to some data the memory is allocated from a bump allocator.

There are also some improvements on how the ParsedSyntaxBuilders work.
This eliminates the overhead of doing name lookups during parsing (which is unncessary during syntactic parsing) by enabling the `EnableASTScopeLookup` lang option.
@akyrtzi akyrtzi requested review from nkcsgexi and rintaro January 17, 2019 20:47
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jan 17, 2019

@swift-ci smoke test

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

Looking good!

@akyrtzi akyrtzi merged commit 049c3cd into swiftlang:master Jan 18, 2019
@akyrtzi akyrtzi deleted the syntax-parser-opt branch January 18, 2019 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants