]> Cypherpunks repositories - gostls13.git/commit
net/http: use SplitSeq in ParseCookie
authorCarlo Alberto Ferraris <cafxx@strayorange.com>
Fri, 5 Dec 2025 23:39:39 +0000 (08:39 +0900)
committerGopher Robot <gobot@golang.org>
Wed, 4 Feb 2026 23:16:43 +0000 (15:16 -0800)
commitc5a3cf6e0888510922b04e978f4e30221b70aaaf
treedfca04db0c48165b8711d9b94cb18c351a3b501c
parent3b092b27a9490382199cf793a652d922fd457315
net/http: use SplitSeq in ParseCookie

goos: linux
goarch: amd64
pkg: net/http
cpu: 12th Gen Intel(R) Core(TM) i7-12700
                           │ master.txt  │             patch.txt              │
                           │   sec/op    │   sec/op     vs base               │
ReadCookies/readCookies-20   1.499µ ± 1%   1.482µ ± 3%       ~ (p=0.197 n=10)
ReadCookies/ParseCookie-20   1.552µ ± 2%   1.437µ ± 2%  -7.44% (p=0.000 n=10)
geomean                      1.525µ        1.459µ       -4.34%

                           │  master.txt  │               patch.txt               │
                           │     B/op     │     B/op      vs base                 │
ReadCookies/readCookies-20   1.953Ki ± 0%   1.953Ki ± 0%       ~ (p=1.000 n=10) ¹
ReadCookies/ParseCookie-20   2.109Ki ± 0%   1.953Ki ± 0%  -7.41% (p=0.000 n=10)
geomean                      2.030Ki        1.953Ki       -3.77%
¹ all samples are equal

                           │ master.txt │              patch.txt              │
                           │ allocs/op  │ allocs/op   vs base                 │
ReadCookies/readCookies-20   11.00 ± 0%   11.00 ± 0%       ~ (p=1.000 n=10) ¹
ReadCookies/ParseCookie-20   12.00 ± 0%   11.00 ± 0%  -8.33% (p=0.000 n=10)
geomean                      11.49        11.00       -4.26%
¹ all samples are equal

Change-Id: I7e84d52ac8d25991595d1b0480334fe9d1a84ffb
Reviewed-on: https://go-review.googlesource.com/c/go/+/727520
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>
src/net/http/cookie.go
src/net/http/cookie_test.go