]> Cypherpunks repositories - gostls13.git/commit
net/http: reuse bufio.Reader and bufio.Writer between conns
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Mar 2013 03:02:01 +0000 (20:02 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Mar 2013 03:02:01 +0000 (20:02 -0700)
commit985b0992cd78d277c9295234d0aa802109d39fd0
tree5e5f3b39eff65d571cfef7347d12dbd90b1c9111
parentdc71ace28261a37922afe02d36a02adf50ba2f94
net/http: reuse bufio.Reader and bufio.Writer between conns

Saves over 8KB of allocations per new connection.

benchmark                             old ns/op    new ns/op    delta
BenchmarkServerFakeConnNoKeepAlive        28777        24927  -13.38%

benchmark                            old allocs   new allocs    delta
BenchmarkServerFakeConnNoKeepAlive           52           46  -11.54%

benchmark                             old bytes    new bytes    delta
BenchmarkServerFakeConnNoKeepAlive        13716         5286  -61.46%

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