Files
CLIProxyAPI/internal/api
JohnsonRan 16c6b4bd8c perf(api): reuse response compression encoders with a smaller zstd window
Every compressed response created a new encoder: zstd with its default
8 MiB window allocated about 18 MB, gzip about 1 MB, and an open SSE
stream held that for its whole life. Pool zstd and gzip encoders, and
give zstd a 1 MiB window with lower encoder memory; API responses are
far smaller than the window, so the wire size is unchanged. finish now
returns the encoder to the pool and fails later writes instead of
sending them uncompressed under Content-Encoding.
2026-10-28 03:51:21 +09:00
..