| commit | 077b5fce825e79d84592fff893639b92b637eec7 | [log] [tgz] |
|---|---|---|
| author | Duru Can Celasun <dcelasun@apache.org> | Wed Sep 30 07:25:51 2020 +0100 |
| committer | GitHub <noreply@github.com> | Wed Sep 30 07:25:51 2020 +0100 |
| tree | 71b623e3085c1d77d53a6189a0658f86a9b5e7ed | |
| parent | 062521f3b6f578d2b78f0ba189cf5d7968074cb1 [diff] |
go: Use sync.Pool for gzip in HTTP transport b67cad4 introduced transparent gzip support for the HTTP transport but calling gzip.NewWriter() with every request causes a large number of memory allocations [1] and can create GC pressure. Avoid this by using a sync.Pool for gzip writers. [1] https://old.reddit.com/r/golang/comments/9uejp4/usage_of_syncpool_for_gzipwriter_in_http_handlers/e94jh8c/