]> Cypherpunks repositories - gostls13.git/commit
net/http: reuse textproto.Readers; remove 2 more allocations
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 21:51:21 +0000 (14:51 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 21:51:21 +0000 (14:51 -0700)
commit1b0d04b89fa12bf635467e0ef7acff3fcc78d208
tree898486f4d09e6d1cb6078e8aed03d7ac415da13d
parentf1b7c140ffe42db59b51937037b2af6c48fa94b0
net/http: reuse textproto.Readers; remove 2 more allocations

Saves both the textproto.Reader allocation, and its internal
scratch buffer growing.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10324        10149   -1.70%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           19           17  -10.53%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1559         1492   -4.30%

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/8094046
src/pkg/net/http/request.go