Skip to content

Conversation

@headius
Copy link
Member

@headius headius commented Aug 17, 2019

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 1 from 46240 (1110264 bytes) to 13984 instances (335616 bytes).

Copy link
Member

@enebo enebo left a comment

Choose a reason for hiding this comment

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

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).

@headius
Copy link
Member Author

headius commented Aug 19, 2019

@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.

@headius headius closed this Aug 19, 2019
@headius headius added this to the Invalid or Duplicate milestone Aug 19, 2019
@headius headius deleted the reuse_sourceposition branch August 21, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants