Reuse existing source position if it matches#5838
Closed
headius wants to merge 1 commit intojruby:masterfrom
Closed
Reuse existing source position if it matches#5838headius wants to merge 1 commit intojruby:masterfrom
headius wants to merge 1 commit intojruby:masterfrom
Conversation
enebo
reviewed
Aug 19, 2019
Member
enebo
left a comment
There was a problem hiding this comment.
I am not fully sure this will be correct in presence of heredocs or other things which read past a token then in grammar asks for tokline (line of last token).
With that said ruby-2_6 branch has completely removed SimpleSourcePosition so I could entertain trying to move that back to 9.2.x. I did more than just that but the gist of that change was all Nodes are ISourcePosition implementors (but only RootNode contains the actual file).
Member
Author
|
@enebo Ahh yes, I remember the change you made for 2.6. This patch was a substantial reduction but eliminating them altogether is obviously better. We can wait for your change or backport it but I'll close this one. |
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 seems simple enough but causes some off-by-one issues for reasons I have not managed to figure out.
If this change can work, it reduces SimpleSourcePosition allocation during
-e 1from 46240 (1110264 bytes) to 13984 instances (335616 bytes).