Repository navigation
Conversation
This makes google-java-format as a whole run in about a third of the time on my (already-correctly-formatted) codebase.
Collaborator
|
Thanks for catching this. I think there's an underlying bug that's causing this code to be called more than it should be. Can you you how the performance of this fix compares to cushon@b9751f3 on your codebase? |
Author
|
Yours is better (7s vs 8s on my random test codebase). I'm closing this PR, on the assumption that you'll merge yours. |
cushon
added a commit
that referenced
this pull request
Oct 12, 2017
… the last token This was causing JavaInput to spend a lot of time computing the end column on the last line of that column, see #208 MOE_MIGRATED_REVID=171896806
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 makes google-java-format as a whole run in about a third of the
time on my (already-correctly-formatted) codebase.
I could probably use a cache with an LRU eviction policy here, but it's not clear what size is reasonable. I could also do a per-file cache, but (a) often most files start with the same copyright header, and (b) the most-frequently-used item in the cache is " ", so there's some between-files sharing.