Files
CLIProxyAPI/internal/runtime/executor/helps
sususu98 40beca02c8 perf(payload,handlers): eliminate large base64 allocation amplification
Avoid full-payload copies when evaluating payload rules and reading HTTP
request bodies, cutting heap allocation amplification on multi-megabyte
base64 requests by >80% with zero behavioral changes:

- Evaluate single-item payload query predicates directly on ojson.Result
  without copying item.Raw into a temporary "[...]" buffer (with exact
  fallback for edge/malformed syntax).
- Resolve clean array "@reverse.<N>" paths via zero-copy ForEach traversal
  instead of ojson.modReverse full-array cloning.
- Fast-path scalar, empty-container ([] / {}), and type-mismatch checks in
  payloadResultEquals to skip moego/json.Unmarshal on large arrays, and use
  bytes.TrimSpace in normalizedPayloadJSON.
- Cache compiled moego/regexp patterns in payload.replace with a bounded map.
- Release originalRequest in ClaudeInputTokenState once disabled or handled,
  and only retain replayRequestPayload in Antigravity stream when replayScope
  is valid.
- Preallocate raw request body buffers from Content-Length (capped at 4 MiB)
  in ReadRawRequestBody to avoid io.ReadAll slice-doubling copies.
2026-11-29 12:22:41 +08:00
..