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/
1 file changed