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

Set intersection should be relative to the smaller operand #531

Closed
tsandall opened this issue Dec 18, 2017 · 1 comment
Closed

Set intersection should be relative to the smaller operand #531

tsandall opened this issue Dec 18, 2017 · 1 comment

Comments

@tsandall
Copy link
Member

Currently ast.Set#Intersect (ast/term.go) does not check the sizes of either operand. As a result, intersecting two sets may be unnecessarily expensive. We should change the implementation to iterate over the smaller set.

@tsandall
Copy link
Member Author

A benchmark test should be included in term_test.go along with this fix.

kichristensen added a commit to kichristensen/opa that referenced this issue Oct 11, 2018
Fixes open-policy-agent#531

Signed-off-by: Kim Christensen <kimworking@gmail.com>
tsandall pushed a commit that referenced this issue Oct 11, 2018
Fixes #531

Signed-off-by: Kim Christensen <kimworking@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant