]> Cypherpunks repositories - gostls13.git/commit
net/http: more tests, better comments, remove an allocation
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 18:35:24 +0000 (11:35 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 18:35:24 +0000 (11:35 -0700)
commit972cb4b442d6348868051c71304b348992519f4a
tree5848b1204b89e9f590df07509050fcdd2b52c3a6
parent8877a2dfee4cd37825f0df2fa7bb53573d04ae5b
net/http: more tests, better comments, remove an allocation

Add more tests around the various orders handlers can access
and flush response headers.

Also clarify the documentation on fields of response and
chunkWriter.

While there, remove an allocation (a header clone) for simple
handlers.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        15245        14966   -1.83%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           24           23   -4.17%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1717         1668   -2.85%

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