go/src
Cyrill Schumacher 6899843355 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>
2016-10-12 14:59:36 +00:00
..
archive archive/zip: only use Extended Timestamp on non-zero MS-DOS timestamps 2016-10-11 21:31:25 +00:00
bufio bufio: remove redundant Writer.flush method 2016-10-01 15:46:15 +00:00
builtin builtin: clarify that make(map[K]V, n) allocates space for n elements 2016-09-10 12:57:37 +00:00
bytes strings, bytes: panic if Repeat overflows or if given a negative count 2016-10-01 15:47:35 +00:00
cmd cmd/compile/internal/gc: add runtime/trace support 2016-10-12 13:57:26 +00:00
compress compress/gzip: document Reader.Read 2016-10-09 00:22:59 +00:00
container container/list: silence vet warnings 2016-08-16 14:35:37 +00:00
context context: make DeadlineExceeded implement net.Error 2016-10-05 15:53:04 +00:00
crypto crypto/x509: parse all names in an RDN. 2016-10-11 17:35:55 +00:00
database/sql database/sql: fixup remaining driver call to use context 2016-10-04 17:22:14 +00:00
debug debug/elf: add sparc64 relocations 2016-10-11 21:52:37 +00:00
encoding encoding/base64: This change modifies Go to take strict option when decoding base64 2016-10-12 03:56:18 +00:00
errors
expvar expvar: export http.Handler 2016-09-25 23:34:28 +00:00
flag flag: use strconv instead of fmt in values' String funcs 2016-09-10 10:29:44 +00:00
fmt fmt: document and adjust Scanf space handling to eliminate a few paradoxes 2016-10-07 03:46:50 +00:00
go go/types: expose Default function, which converts untyped T to T 2016-10-12 14:59:23 +00:00
hash hash/crc32: cleanup code and improve tests 2016-08-31 15:17:57 +00:00
html html/template: check "type" attribute in <script> 2016-09-29 20:12:31 +00:00
image image/gif: check handling of truncated GIF files 2016-10-05 04:28:45 +00:00
index/suffixarray index/suffixarray: add Lookup example 2016-08-21 01:10:22 +00:00
internal os: add new tests for symbolic links and directory junctions 2016-10-12 05:59:16 +00:00
io io: simplified a small part of copyBuffer 2016-10-09 22:50:12 +00:00
log log/syslog: document that Dial uses net.Dial parameters, add example 2016-08-19 01:01:47 +00:00
math math/big: move ProbablyPrime into its own source file 2016-10-11 16:16:17 +00:00
mime net/http: multipart ReadForm close file after copy 2016-10-05 16:35:03 +00:00
net net/http: optimize internal cookie functions 2016-10-12 14:59:36 +00:00
os os: add examples of environment functions 2016-10-12 14:04:30 +00:00
path path/filepath: add a test case for EvalSymlinks error 2016-10-12 14:01:03 +00:00
plugin plugin: darwin support 2016-09-23 02:16:42 +00:00
reflect reflect: ignore struct tags when converting structs 2016-10-04 17:15:59 +00:00
regexp regexp: remove dead code 2016-10-04 14:49:35 +00:00
runtime runtime: update mkduff legacy comments 2016-10-12 14:51:50 +00:00
sort sort: fix a slice benchmark not using the stable variant, add another 2016-10-05 14:43:23 +00:00
strconv strconv: fix function name in errors for Atoi 2016-09-04 00:17:58 +00:00
strings strings, bytes: panic if Repeat overflows or if given a negative count 2016-10-01 15:47:35 +00:00
sync cmd/compile: intrinsify sync/atomic for amd64 2016-08-30 15:23:23 +00:00
syscall syscall: unify NsecToTime{spec,val}, fix for times < 1970 2016-10-12 13:10:54 +00:00
testing testing: add Name method to *T and *B 2016-09-28 10:15:28 +00:00
text text/template: improve lexer performance in finding left delimiters. 2016-09-13 12:51:13 +00:00
time time: document that calendrical calculations are with no leap seconds 2016-10-06 19:43:14 +00:00
unicode unicode/utf8: reduce bounds checks in EncodeRune 2016-09-03 20:05:36 +00:00
unsafe unsafe: document use of &^ to round/align pointers 2016-08-18 16:45:17 +00:00
vendor/golang_org/x vendor: update vendored lif 2016-10-08 00:02:11 +00:00
all.bash
all.bat
all.rc
androidtest.bash androidtest.bash: use go list to get pkg dir 2016-08-29 15:24:39 +00:00
bootstrap.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash cmd/compile: switch to compact export format by default 2016-04-27 16:59:55 +00:00
iostest.bash
make.bash cmd/dist, cmd/go: add environment variable override for pkg-config 2016-10-03 18:08:01 +00:00
make.bat build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
Make.dist
make.rc build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
naclmake.bash
nacltest.bash all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
race.bash
race.bat
run.bash build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
run.bat build: unset GOBIN during build 2016-05-19 18:40:53 +00:00
run.rc build: unset GOBIN during build 2016-05-19 18:40:53 +00:00