mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-16 22:57:53 +08:00
sjson.DeleteBytes copies the whole document even when the path is missing: appendRawPaths builds a prefix copy that is discarded, then set() copies the input again before SetBytes returns the original slice. The summary config and the Gemini/Antigravity level and budget appliers defensively delete several alias spellings that are almost always absent, so each request paid several full-body copies. Add util.DeleteJSONBytesIfExists, which checks the path with GetGJSONBytesNoCopy first, and use it at those call sites. Output is unchanged. On a 1 MiB Antigravity body, applySummaryConfigForProvider drops from 7.4 MB to 1.1 MB allocated per call. In a production heap profile these deletes were 35 GB of 192 GB allocated over 72 minutes.