-
Notifications
You must be signed in to change notification settings - Fork 37
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
Adapt to new location format #1153
Conversation
f8d0407
to
9c4dd67
Compare
mem.pprof
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presume this was not meant to be committed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was left to see if someone would actually scroll through :P No, thanks! Removing before merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! this is a really nice improvement
9c4dd67
to
2e014ee
Compare
Wow, this took quite some time to finish! But looking at the end result, I'd say it was worth it. Having Roast represent locations as `row:col:end_row:end_col` means quite a reduction in AST size, and Regal's own JSON AST goes from 12 Mb to 10 Mb (in OPA AST that is 24 Mb for comparison). Running `regal lint bundle` is also ~100 ms faster, and improvement of about 5%. Nice! But this wasn't only about performance. Having end locations available for any node means we can now easily show e.g. violations with a precise location in LSP editors, and won't have to default to end-of-line, as we previously did for most rules. This also meant that we were able to remove all code in Regal that tried to calculate end position based on the text attribute. Nice! Signed-off-by: Anders Eknert <anders@styra.com>
2e014ee
to
227c102
Compare
Wow, this took quite some time to finish! But looking at the end result, I'd say it was worth it. Having Roast represent locations as `row:col:end_row:end_col` means quite a reduction in AST size, and Regal's own JSON AST goes from 12 Mb to 10 Mb (in OPA AST that is 24 Mb for comparison). Running `regal lint bundle` is also ~100 ms faster, and improvement of about 5%. Nice! But this wasn't only about performance. Having end locations available for any node means we can now easily show e.g. violations with a precise location in LSP editors, and won't have to default to end-of-line, as we previously did for most rules. This also meant that we were able to remove all code in Regal that tried to calculate end position based on the text attribute. Nice! Signed-off-by: Anders Eknert <anders@styra.com>
Wow, this took quite some time to finish! But looking at the end result, I'd say it was worth it. Having Roast represent locations as
row:col:end_row:end_col
means quite a reduction in AST size, and Regal's own JSON AST goes from 12 Mb to 10 Mb (in OPA AST that is 24 Mb for comparison).Running
regal lint bundle
is also ~100 ms faster, and improvement of about 5%. Nice!But this wasn't only about performance. Having end locations available for any node means we can now easily show e.g. violations with a precise location in LSP editors, and won't have to default to end-of-line, as we previously did for most rules. This also meant that we were able to remove all code in Regal that tried to calculate end position based on the text attribute. Nice!
NOTE: this should be merged after anderseknert/roast#11 so that we can depend on a tagged roast version.