Feature Request: CopyNonGround() Optimization for Term Types #741
-
|
Following maintainer feedback on previous PRs to focus on optimizations that demonstrate measurable production impact rather than microbenchmark improvements, I profiled OPA in our production environment. Term copying emerged as one of the dominant memory consumers, particularly for refs, arrays, sets, and objects during policy evaluation. ObservationCurrent Analysis of ProposalImplement Apply at call sites in:
Would the OPA maintainers be open to a PR with this optimization? The code changes are minimal, well-tested, and demonstrate measurable production improvements as requested in previous feedback. This is a focused micro-optimization that reduces unnecessary allocations without architectural changes or API breaks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Indeed, that sounds like a worthwhile optimization to me 👍 |
Beta Was this translation helpful? Give feedback.
-
|
@anderseknert Thank you for your feedback. I've prepared the code for this PR in my branch. Could you please take a look at open-policy-agent/opa#8233 when you have a chance? From what I understood from the last comment (open-policy-agent/opa#8233 (comment)), I cannot open a new PR with changes until the previous one is resolved. 🙂 |
Beta Was this translation helpful? Give feedback.
Indeed, that sounds like a worthwhile optimization to me 👍