Renaming functions during compile #1282
Unanswered
vivshankar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have been using cel-go for many years and introduced a set of utilities that used cel.Function and cel.Overload, instead of receiver-style custom types. These functions required context from the activation and, since the function/overload does not have access to the activation, we ended up creating a new instance of the library for each call to execute the expression.
Example code:
We then extend the environment with a new instance of someLib per invocation. Given each extend results in copying objects, this has an impact overall on memory utilization. Unfortunately, since this has been in use for many years, replacing
someFuncwith something likesome.funcas a custom type receiver is challenging.Is there any way that we might be able to do this during compile time when the AST is built?
Beta Was this translation helpful? Give feedback.
All reactions