-
Notifications
You must be signed in to change notification settings - Fork 227
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
Runtime support for cel.@block #1048
Conversation
8984ea8
to
ef6eeff
Compare
interpreter.Activation | ||
slotExprs []interpreter.Interpretable | ||
slotCount int | ||
slotVals []*slotVal |
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.
I personally would just avoid the pointer here.
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.
The pointer ends up being pretty convenient since it means that I can update the slotVal
state without having to set the slot index multiple times.
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.
Any other concerns? I've written it both ways and the visit logic is easier to follow with the pointers. Object pooling generally solves any overhead concerns. See #1056
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.
I wound up running tests against the pooled allocations versus stack-based allocs and overall the pointers with pooled memory were a 5% win, so I'm sticking with that for now and just merged the policy composition support. Happy to come back to this as a follow up if desired.
Introduces runtimes support for
cel.@block
CEL block is used by static optimizers to group subexpressions together
such that the following is true:
variable:
@index<ordinal>
@index<N>
may only depend on variables represented in
@index<N-1>
comprehension represents a scope which declares its own variables.
Depends on google/cel-spec#402 before submission