mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
6308609195
This commit greatly extends the sync.Pool usage within the EditTree data structure, and adds Dispose calls to the appropriate call sites within the JSON Patch builtins. This has a higher cost than the original "just unlink the nodes" approach, but reduces GC and allocation pressure when there's lots of churn and deletion operations. Benchmarks indicate a 5-15% CPU time cost increase, in exchange for a 15-18%+ reduction in memory usage and allocs. Signed-off-by: Philip Conrad <philip@chariot-chaser.net>