Skip to content

[AST] Retrive EndLine after StartLineAndColumn for SingleRawComment #14733

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 1 commit into from
Feb 21, 2018

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 20, 2018

llvm::SourceMgr caches the position and the line number of the last query. For subsequent queries, it usually scans from that position. However, if the query is for a position ahead of the last query, it re-scan from the top of the whole buffer. This significally slows down the performance.

This change effectively mitigate SourceKit performance regressions introduced in #11264 without functional changes.

rdar://problem/37570893

llvm::SourceMgr caches the line and column of the last query. It
usually scans from that position for subsequent queries. However, if the
query is for a position ahead of the last query, it re-scan from the top
of the whole buffer. This significally slows down the performance.

This change effectively mitigate performance regression introduced in
swiftlang#11264 without functional changes.
@rintaro rintaro requested a review from akyrtzi February 20, 2018 07:06
@rintaro
Copy link
Member Author

rintaro commented Feb 20, 2018

@swift-ci Please smoke test

@rintaro rintaro changed the title [AST] Retrive EndLine after StartStartLineAndColumn for SingleRawComment [AST] Retrive EndLine after StartLineAndColumn for SingleRawComment Feb 20, 2018
@rintaro rintaro merged commit a9784c7 into swiftlang:master Feb 21, 2018
@rintaro rintaro deleted the ast-comment-endline branch February 21, 2018 00:51
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