Skip to content
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

perf: Walk less #965

Merged
merged 1 commit into from
Aug 6, 2024
Merged

perf: Walk less #965

merged 1 commit into from
Aug 6, 2024

Conversation

anderseknert
Copy link
Member

  • Use ast.found.refs instead of walk in use-some-for-output-vars
  • Cheaper walk over else in default-over-else and use-assignment-operator
  • Remove some unnecessary code in external-reference

The plan was also to consolidate ast.found.symbols with ast.found.refs, but that had disastrous consequences leading to something I think is a bug in OPA. I have demonstrated that to @charlieegan3, but will need to consult the OPA team once they're back from vacation.

Copy link
Member

@charlieegan3 charlieegan3 left a comment

Choose a reason for hiding this comment

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

Looks good to me, no requests!

- Use `ast.found.refs` instead of `walk` in `use-some-for-output-vars`
- Cheaper `walk` over `else` in `default-over-else` and `use-assignment-operator`
- Remove some unnecessary code in `external-reference`

The plan was also to consolidate `ast.found.symbols` with `ast.found.refs`, but
that had disastrous consequences leading to something I think is a bug in OPA.
I have demonstrated that to @charlieegan3, but will need to consult the OPA team
once they're back from vacation.

Signed-off-by: Anders Eknert <anders@styra.com>
@anderseknert anderseknert merged commit 3f3ad8e into main Aug 6, 2024
3 checks passed
@anderseknert anderseknert deleted the walk-less branch August 6, 2024 09:59
srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
- Use `ast.found.refs` instead of `walk` in `use-some-for-output-vars`
- Cheaper `walk` over `else` in `default-over-else` and `use-assignment-operator`
- Remove some unnecessary code in `external-reference`

The plan was also to consolidate `ast.found.symbols` with `ast.found.refs`, but
that had disastrous consequences leading to something I think is a bug in OPA.
I have demonstrated that to @charlieegan3, but will need to consult the OPA team
once they're back from vacation.

Signed-off-by: Anders Eknert <anders@styra.com>
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