net/http2: pool transport gzip readers

This is a copy of the CL 510255 with the difference that
it preserves use of fs.ErrClosed when reading after close.

goos: darwin
goarch: arm64
pkg: golang.org/x/net/http2
cpu: Apple M4
              │   HEAD~1    │             HEAD              │
              │   sec/op    │   sec/op     vs base          │
ClientGzip-10   752.8µ ± 1%   750.7µ ± 2%  ~ (p=0.393 n=10)

              │    HEAD~1    │                 HEAD                 │
              │     B/op     │     B/op      vs base                │
ClientGzip-10   75.49Ki ± 0%   33.98Ki ± 3%  -54.99% (p=0.000 n=10)

              │   HEAD~1   │               HEAD                │
              │ allocs/op  │ allocs/op   vs base               │
ClientGzip-10   705.0 ± 0%   698.5 ± 0%  -0.92% (p=0.000 n=10)

Updates golang/go#61353

Change-Id: I0fdc0c0a5947d27dcc615e5bcf4d4620c2c95d9e
GitHub-Last-Rev: 4d04dc93f37ec6cdaf36c6851250806166f4e8c1
GitHub-Pull-Request: golang/net#239
Reviewed-on: https://go-review.googlesource.com/c/net/+/710235
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2 files changed
tree: e476888b96ab8852e8bdd2abd7bb420e2862c5e8
  1. bpf/
  2. context/
  3. dict/
  4. dns/
  5. html/
  6. http/
  7. http2/
  8. icmp/
  9. idna/
  10. internal/
  11. ipv4/
  12. ipv6/
  13. lif/
  14. nettest/
  15. netutil/
  16. proxy/
  17. publicsuffix/
  18. quic/
  19. route/
  20. trace/
  21. webdav/
  22. websocket/
  23. xsrftoken/
  24. .gitattributes
  25. .gitignore
  26. codereview.cfg
  27. CONTRIBUTING.md
  28. go.mod
  29. go.sum
  30. LICENSE
  31. PATENTS
  32. README.md
README.md

Go Networking

Go Reference

This repository holds supplementary Go networking packages.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/net.

The main issue tracker for the net repository is located at https://go.dev/issues. Prefix your issue with “x/net:” in the subject line, so it is easy to find.