1
0
mirror of https://github.com/golang/go synced 2024-11-19 17:24:41 -07:00
go/src/pkg
Brad Fitzpatrick babbd55e5d net/http: fewer allocations in chunkWriter.WriteHeader
It was unnecessarily cloning and then mutating a map that had
a very short lifetime (just that function).

No new tests, because they were added in revision 833bf2ef1527
(TestHeaderToWire). The benchmarks below are from the earlier
commit, revision 52e3407d.

I noticed this inefficiency when reviewing a change Peter Buhr
is looking into, which will also use these benchmarks.

benchmark                         old ns/op    new ns/op    delta
BenchmarkServerHandlerTypeLen         12547        12325   -1.77%
BenchmarkServerHandlerNoLen           12466        11167  -10.42%
BenchmarkServerHandlerNoType          12699        11800   -7.08%
BenchmarkServerHandlerNoHeader        11901         9210  -22.61%

benchmark                        old allocs   new allocs    delta
BenchmarkServerHandlerTypeLen            21           20   -4.76%
BenchmarkServerHandlerNoLen              20           18  -10.00%
BenchmarkServerHandlerNoType             20           18  -10.00%
BenchmarkServerHandlerNoHeader           17           13  -23.53%

benchmark                         old bytes    new bytes    delta
BenchmarkServerHandlerTypeLen          1930         1913   -0.88%
BenchmarkServerHandlerNoLen            1912         1879   -1.73%
BenchmarkServerHandlerNoType           1912         1878   -1.78%
BenchmarkServerHandlerNoHeader         1491         1086  -27.16%

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/8268046
2013-04-02 16:27:23 -07:00
..
archive archive/tar: remove execute bit from common.go 2013-03-03 08:56:08 +11:00
bufio bufio: add some tests 2013-03-21 19:59:49 -07:00
builtin builtin: add linkable-to declarations for iota and nil 2013-03-26 11:05:06 -07:00
bytes runtime: Implement faster equals for strings and bytes. 2013-04-02 16:26:15 -07:00
compress compress/gzip: add Writer.Flush to call flate.Writer's Flush 2013-04-02 09:07:43 -07:00
container container/heap: fix int overflow bug 2013-03-04 10:25:21 -05:00
crypto crypto/rsa: don't correct private exponent unless needed. 2013-03-25 19:08:29 -04:00
database/sql database/sql: optimized []byte copy + []byte(nil) -> *interface fix 2013-03-25 17:43:30 -07:00
debug debug/elf: repair GNU version symbols. 2013-03-22 01:27:55 +01:00
encoding build: remove dead code 2013-03-22 17:28:22 -04:00
errors
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 all: Skip AllocsPerRun tests if GOMAXPROCS>1. 2013-03-06 15:52:32 -08:00
go go/printer: use strings.Split instead of specialized code 2013-03-28 15:47:39 -07:00
hash build: update assembly variable names for vet 2013-03-22 12:57:55 -04:00
html build: remove dead code 2013-03-22 17:28:22 -04:00
image image/gif: make test repeatable 2013-03-26 16:20:17 +11:00
index/suffixarray
io all: remove now-unnecessary unreachable panics 2013-03-11 14:16:55 -07:00
log log/syslog: fix race in test between channel close and accept. 2013-02-28 07:48:16 +01:00
math math: make Hypot special cases look like others 2013-03-25 17:01:40 -04:00
mime src/pkg: fixed various typos 2013-03-20 16:32:37 -07:00
net net/http: fewer allocations in chunkWriter.WriteHeader 2013-04-02 16:27:23 -07:00
os os/exec, syscall: fix tests to pass when GOGCTRACE=1 is set 2013-03-30 09:22:11 -07:00
path all: Skip AllocsPerRun tests if GOMAXPROCS>1. 2013-03-06 15:52:32 -08:00
reflect reflect: add garbage collection info in ChanOf, MapOf, PtrTo, SliceOf 2013-03-26 11:50:29 -07:00
regexp regexp: identify that submatch is also known as capturing group 2013-03-11 16:23:06 -07:00
runtime runtime: Implement faster equals for strings and bytes. 2013-04-02 16:26:15 -07:00
sort sort: be consistent when describing "less: function in the multiKeys example 2013-04-02 10:25:02 -07:00
strconv build: remove dead code 2013-03-22 17:28:22 -04:00
strings bytes,strings: remove user name from BUG in comment 2013-03-19 15:04:18 -07:00
sync sync/atomic: make unaligned 64-bit atomic operation panic on ARM 2013-04-01 14:34:03 -07:00
syscall os/exec, syscall: fix tests to pass when GOGCTRACE=1 is set 2013-03-30 09:22:11 -07:00
testing testing: document that Log and Logf do not usually produce output 2013-04-01 15:17:00 -07:00
text text/template: fix bug in evaluating a chain starting with a function. 2013-03-27 16:31:14 -07:00
time all: Skip AllocsPerRun tests if GOMAXPROCS>1. 2013-03-06 15:52:32 -08:00
unicode unicode: modify a comment to the convention format. 2013-03-19 14:47:41 -04:00
unsafe unsafe: fix a typo 2012-10-19 16:35:15 +11:00