diff options
| author | Cyrill Schumacher <cyrill@schumacher.fm> | 2016-08-20 11:32:32 +0200 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2016-10-12 14:59:36 +0000 |
| commit | 68998433556a5c9ee0f7d8d544ffb006a724adaf (patch) | |
| tree | a29b4888369a87af0a461baca0267b441260efbd /src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA | |
| parent | 9c850958cea35d019142f8341beacb4151e1511b (diff) | |
| download | go-68998433556a5c9ee0f7d8d544ffb006a724adaf.tar.xz | |
net/http: optimize internal cookie functions
- precalculate *Cookie slice in read cookie functions
- readSetCookies: pre-allocs depending on the count of Set-Cookies
- rename success variable to ok; avoid else
- refactor Cookie.String to use less allocations
- remove fmt package and replace with writes to a bytes.Buffer
- add BenchmarkReadSetCookies and BenchmarkReadCookies
name old time/op new time/op delta
CookieString-8 1.42µs ± 2% 0.78µs ± 1% -45.36% (p=0.000 n=10+10)
ReadSetCookies-8 3.46µs ± 1% 3.42µs ± 2% -1.39% (p=0.001 n=10+10)
ReadCookies-8 5.12µs ± 1% 5.15µs ± 2% ~ (p=0.393 n=10+10)
name old alloc/op new alloc/op delta
CookieString-8 520B ± 0% 384B ± 0% -26.15% (p=0.000 n=10+10)
ReadSetCookies-8 968B ± 0% 960B ± 0% -0.83% (p=0.000 n=10+10)
ReadCookies-8 2.01kB ± 0% 2.01kB ± 0% ~ (all samples are equal)
name old allocs/op new allocs/op delta
CookieString-8 10.0 ± 0% 3.0 ± 0% -70.00% (p=0.000 n=10+10)
ReadSetCookies-8 18.0 ± 0% 17.0 ± 0% -5.56% (p=0.000 n=10+10)
ReadCookies-8 16.0 ± 0% 16.0 ± 0% ~ (all samples are equal)
Change-Id: I870670987f10f3e52f9c657cfb8e6eaaa97a6162
Reviewed-on: https://go-review.googlesource.com/27850
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA')
0 files changed, 0 insertions, 0 deletions
