commit | 63522dbf7eec79acb34c1eb827fb0527d168c182 | [log] [tgz] |
---|---|---|
author | Olivier Poitrey <rs@rhapsodyk.net> | Tue Mar 17 14:53:13 2020 -0700 |
committer | Emmanuel Odeke <emm.odeke@gmail.com> | Thu Mar 19 23:41:17 2020 +0000 |
tree | 0d3c292e82071be7f74b79f83bbaa3f1dcb0298a | |
parent | 244492dfa37ae2ce87222fd06250a03160745faa [diff] |
http2: reduce allocations of (*clientConnReadLoop).handleReponse Reduce allocation by using 1 capacity slices out of a single pre-allocated slice for header values, similarly to how it is done in textproto.(*Reader).ReadMIMEHeader. name old time/op new time/op delta ClientResponseHeaders/___0_Headers-16 82.3µs ± 7% 76.4µs ± 4% -7.18% (p=0.000 n=10+10) ClientResponseHeaders/__10_Headers-16 101µs ± 2% 99µs ± 3% -2.00% (p=0.016 n=8+10) ClientResponseHeaders/_100_Headers-16 213µs ± 2% 202µs ± 4% -4.96% (p=0.000 n=9+9) ClientResponseHeaders/1000_Headers-16 2.28ms ± 1% 2.15ms ± 2% -5.58% (p=0.000 n=8+10) name old alloc/op new alloc/op delta ClientResponseHeaders/___0_Headers-16 4.60kB ± 0% 4.60kB ± 0% ~ (p=0.201 n=10+10) ClientResponseHeaders/__10_Headers-16 9.01kB ± 0% 8.66kB ± 0% -3.96% (p=0.000 n=10+10) ClientResponseHeaders/_100_Headers-16 54.4kB ± 0% 48.4kB ± 0% -11.01% (p=0.000 n=10+10) ClientResponseHeaders/1000_Headers-16 702kB ± 0% 595kB ± 0% -15.28% (p=0.000 n=10+9) name old allocs/op new allocs/op delta ClientResponseHeaders/___0_Headers-16 57.0 ± 0% 56.0 ± 0% -1.75% (p=0.000 n=10+10) ClientResponseHeaders/__10_Headers-16 135 ± 0% 123 ± 0% -8.89% (p=0.000 n=10+10) ClientResponseHeaders/_100_Headers-16 786 ± 0% 679 ± 0% -13.61% (p=0.000 n=10+10) ClientResponseHeaders/1000_Headers-16 8.14k ± 0% 7.11k ± 0% -12.65% (p=0.000 n=10+10) Fixes golang/go#37853 Change-Id: I0bc6d879293a202a2742a06aca0b6dacfae7fc5f Reviewed-on: https://go-review.googlesource.com/c/net/+/223783 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This repository holds supplementary Go networking libraries.
The easiest way to install is to run go get -u golang.org/x/net
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/net
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the net repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/net:” in the subject line, so it is easy to find.