-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
topdown: memoize partial set results #3492
topdown: memoize partial set results #3492
Conversation
5f42254
to
8b88a91
Compare
I'll incorporate @tsandall's WIP from here https://github.com/tsandall/opa/commits/memoize-partial-sets to capture more cases. Back to draft mode. |
66699fd
to
612ab09
Compare
So now, if a full extent eval of |
93a0547
to
892bf9f
Compare
LGTM. Just squash and merge when you're ready. Closing out a 3-year old issue feels great :D |
We can either cache individual elements (`data.foo.p["bar"]`), or the full extent of a partial set/object. A cached full extent of the partial would be used when evaluating individual elements of the partial. If the first encounter with a partial set/object has to materialize the full extent with a variable key, like `data.foo.p[x]`, then we cache the fully-evaluated result for `data.foo.p`. Fixes open-policy-agent#822. Co-authored-by: Torin Sandall <torinsandall@gmail.com> Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
892bf9f
to
50f96e5
Compare
We can either cache individual elements (`data.foo.p["bar"]`), or the full extent of a partial set/object. A cached full extent of the partial would be used when evaluating individual elements of the partial. If the first encounter with a partial set/object has to materialize the full extent with a variable key, like `data.foo.p[x]`, then we cache the fully-evaluated result for `data.foo.p`. Fixes open-policy-agent#822. Co-authored-by: Torin Sandall <torinsandall@gmail.com> Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com> Signed-off-by: Dolev Farhi <farhi.dolev@gmail.com>
We can either cache individual elements (
data.foo.p["bar"]
), or thefull extent of a partial set/object. A cached full extent of the partial
would be used when evaluating individual elements of the partial.
If the first encounter with a partial set/object has to materialize the
full extent with a variable key, like
data.foo.p[x]
, then we cache thefully-evaluated result for
data.foo.p
.Fixes #822.