1
0
mirror of https://github.com/golang/go synced 2024-10-05 02:11:22 -06:00
go/src/pkg
Dave Cheney 2803744b86 net/textproto: more efficient header parsing
A co creation with bradfitz

* add fast path for header lines which are not continuations
* pass hint to better size initial mime header map

lucky(~/go/src/pkg/net/http) % ~/go/misc/benchcmp {golden,new}.txt
benchmark                          old ns/op    new ns/op    delta
BenchmarkReadRequestChrome             10073         8348  -17.12%
BenchmarkReadRequestCurl                4368         4350   -0.41%
BenchmarkReadRequestApachebench         4412         4397   -0.34%
BenchmarkReadRequestSiege               6431         5924   -7.88%
BenchmarkReadRequestWrk                 2820         3146  +11.56%

benchmark                           old MB/s     new MB/s  speedup
BenchmarkReadRequestChrome             60.66        73.18    1.21x
BenchmarkReadRequestCurl               17.85        17.93    1.00x
BenchmarkReadRequestApachebench        18.58        18.65    1.00x
BenchmarkReadRequestSiege              23.48        25.49    1.09x
BenchmarkReadRequestWrk                14.18        12.71    0.90x

benchmark                         old allocs   new allocs    delta
BenchmarkReadRequestChrome                32           26  -18.75%
BenchmarkReadRequestCurl                  15           15    0.00%
BenchmarkReadRequestApachebench           16           15   -6.25%
BenchmarkReadRequestSiege                 22           19  -13.64%
BenchmarkReadRequestWrk                   11           11    0.00%

benchmark                          old bytes    new bytes    delta
BenchmarkReadRequestChrome              3148         2216  -29.61%
BenchmarkReadRequestCurl                 905         1413   56.13%
BenchmarkReadRequestApachebench          956         1413   47.80%
BenchmarkReadRequestSiege               1397         1522    8.95%
BenchmarkReadRequestWrk                  757         1369   80.85%

R=bradfitz
CC=golang-dev
https://golang.org/cl/7300098
2013-02-14 19:35:38 +11:00
..
archive archive/tar: add Header.FileInfo method. Add more cases to FileInfoHeader. 2013-02-14 17:32:48 +11:00
bufio cmd/gofmt, bufio, image: Consistency and error handling. 2013-01-07 11:15:53 +11:00
builtin builtin: correct comment on builtin function delete(). 2012-12-14 09:13:42 -08:00
bytes bytes: annotate assembly functions with //go:noescape 2013-02-10 00:08:30 +08:00
compress all: use t.Skip{,f} 2013-01-24 17:32:10 +11:00
container container/list: add package example 2013-02-11 17:59:52 +11:00
crypto crypto/x509: disable SCG test with system validation. 2013-02-09 13:51:39 -05:00
database/sql database/sql: fix doc references to old package name 2013-02-13 18:47:25 -08:00
debug all: make tests able to run multiple times. 2013-01-27 00:24:09 +01:00
encoding encoding/xml: fix htmlAutoClose and its generating script 2013-02-13 02:27:42 +08:00
errors
exp go/types: adjust gcimporter to actual gc export data 2013-02-13 10:21:24 -08:00
expvar all: make tests able to run multiple times. 2013-01-27 00:24:09 +01:00
flag all: make tests able to run multiple times. 2013-01-27 00:24:09 +01:00
fmt testing: add AllocsPerRun 2013-02-02 22:52:29 -05:00
go go/types: adjust gcimporter to actual gc export data 2013-02-13 10:21:24 -08:00
hash build: make int 64 bits on amd64 2012-09-24 20:57:01 -04:00
html html/template: remove noescape support 2013-01-18 10:30:12 +11:00
image all: use io.ByteWriter now that it exists 2013-01-08 12:15:19 -08:00
index/suffixarray
io io: document and test new CopyN return behavior 2013-02-13 13:52:00 -08:00
log log/syslog: remove socket files after tests 2013-02-09 08:19:09 +08:00
math math/big: make tests faster by reducing coverage in --test.short mode. 2013-01-30 18:19:58 -05:00
mime mime, strconv: Make testdata more consistent. 2013-01-22 13:44:35 -08:00
net net/textproto: more efficient header parsing 2013-02-14 19:35:38 +11:00
old/netchan gofmt: apply gofmt -w src misc 2012-10-30 13:38:01 -07:00
os os: do not use hosts file for windows tests 2013-02-13 13:19:06 +11:00
path path/filepath: document that Walk does not follow symlinks 2013-02-04 22:59:30 -05:00
reflect testing: add AllocsPerRun 2013-02-02 22:52:29 -05:00
regexp regexp: update comment on (*Regexp).Longest 2013-02-04 15:57:32 +11:00
runtime runtime: tweak addfinroots to preserve original pointer 2013-02-13 22:31:45 -05:00
sort sort: use fewer comparisons when choosing pivot. 2013-02-14 15:04:22 +11:00
strconv testing: add AllocsPerRun 2013-02-02 22:52:29 -05:00
strings bytes, strings: add TrimPrefix and TrimSuffix 2013-02-01 08:41:25 -08:00
sync sync/atomic: support NetBSD/ARM (ARM11 or above) 2013-02-13 01:04:13 +08:00
syscall syscall: NetBSD/ARM support 2013-02-13 01:03:25 +08:00
testing testing: be explicit about use of b.N 2013-02-09 13:43:15 -05:00
text text/template/parse: don't show itemType in error messages 2013-01-22 02:48:40 +08:00
time time: fix error message from Parse 2013-02-04 00:00:36 -05:00
unicode utf8: fix typo. 2013-01-09 11:07:13 -08:00
unsafe unsafe: fix a typo 2012-10-19 16:35:15 +11:00