]> Cypherpunks repositories - gostls13.git/commit
net/http: reduce calls to append in hexEscapeNonASCII to gain a slight performance...
authorAndy Pan <panjf2000@gmail.com>
Wed, 24 Aug 2022 15:02:16 +0000 (23:02 +0800)
committerGopher Robot <gobot@golang.org>
Mon, 27 Feb 2023 22:37:40 +0000 (22:37 +0000)
commit5cded8b3bfb9d47a4e76e6ae8f4cfed15bf49666
tree78fcba4187e3b901446af6e9388f60bdb35bf66f
parent08a68b73a4843dfe8c4896cace3242b895342511
net/http: reduce calls to append in hexEscapeNonASCII to gain a slight performance boost

goos: linux
goarch: amd64
pkg: net/http
cpu: DO-Premium-Intel
                    │     old      │                 new                 │
                    │    sec/op    │   sec/op     vs base                │
HexEscapeNonASCII-4   469.6n ± 20%   371.1n ± 9%  -20.98% (p=0.000 n=10)

                    │    old     │              new               │
                    │    B/op    │    B/op     vs base            │
HexEscapeNonASCII-4   192.0 ± 0%   192.0 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

                    │    old     │              new               │
                    │ allocs/op  │ allocs/op   vs base            │
HexEscapeNonASCII-4   2.000 ± 0%   2.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

Change-Id: Ic8d2b3ddcf2cf724dec3f51a2aba205f2c6e4fe6
Reviewed-on: https://go-review.googlesource.com/c/go/+/425786
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/net/http/http.go
src/net/http/http_test.go