]> Cypherpunks repositories - gostls13.git/commit
net/http: inline chunkWriter in response
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 20:13:28 +0000 (13:13 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 20:13:28 +0000 (13:13 -0700)
commita891484a4edb241ae1b11f3b336f63fe08b10cb7
treedb068eb160b003954d4ed9a65ac6b2bbe5da3ba1
parent42a840860f60b3e66c7bcd755795d193935a05cc
net/http: inline chunkWriter in response

A chunkWriter and a response are 1:1. Make them contiguous in
memory and save an allocation.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10715        10539   -1.64%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           21           20   -4.76%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1626         1609   -1.05%

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/8114043
src/pkg/net/http/server.go