Skip to content

Run recover_comment_removed() only if the text changed after format #1980

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 2 commits into from
Sep 18, 2017

Conversation

topecongiro
Copy link
Contributor

@topecongiro topecongiro commented Sep 18, 2017

One of the most time consuming function in rustfmt is recover_comment_removed(). E.g. it takes up roughly 20% of the execution time when running rustfmt against librustc.
This PR attempts to avoid expensive recover procedure whenever possible by comparing the equality of original text and formatted text.

cc #338

@nrc nrc merged commit 8974f89 into rust-lang:master Sep 18, 2017
@nrc
Copy link
Member

nrc commented Sep 18, 2017

Thank you!

@topecongiro topecongiro deleted the less-recover_comment_removed branch September 19, 2017 10:03
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