]> Cypherpunks repositories - gostls13.git/commit
net/http: pool transport gzip readers
authorAlexander Yastrebov <yastrebov.alex@gmail.com>
Wed, 3 Sep 2025 10:09:08 +0000 (10:09 +0000)
committerGopher Robot <gobot@golang.org>
Sat, 6 Sep 2025 10:00:56 +0000 (03:00 -0700)
commit861c90c907db1129dcd1540eecd3c66b6309db7a
treeb1aa19c5c01f6bdb5295eec968c21800cd0aabe6
parent57769b5532e96a8f6b705035a39ee056a22e04c3
net/http: pool transport gzip readers

goos: linux
goarch: amd64
pkg: net/http
             │   HEAD~1    │              HEAD              │
             │   sec/op    │    sec/op     vs base          │
ClientGzip-8   621.0µ ± 2%   616.3µ ± 10%  ~ (p=0.971 n=10)

             │    HEAD~1     │                 HEAD                 │
             │     B/op      │     B/op      vs base                │
ClientGzip-8   49.765Ki ± 0%   9.514Ki ± 2%  -80.88% (p=0.000 n=10)

             │   HEAD~1   │               HEAD                │
             │ allocs/op  │ allocs/op   vs base               │
ClientGzip-8   57.00 ± 0%   52.00 ± 0%  -8.77% (p=0.000 n=10)

Allocation saving comes from absent compress/flate.(*dictDecoder).init

This change also improves concurrent body read detection by returning an explicit error.

Updates #61353

Change-Id: I380acfca912dc009b3b9c8283e27b3526cedd546
GitHub-Last-Rev: df12f6a48af4854ba686fe431a9aeb6d9ba3c303
GitHub-Pull-Request: golang/go#61390
Reviewed-on: https://go-review.googlesource.com/c/go/+/510255
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/net/http/serve_test.go
src/net/http/transport.go