]> Cypherpunks repositories - gostls13.git/commit
net/http: parse Request-Line in a function, remove an allocation
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 21:19:51 +0000 (14:19 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 28 Mar 2013 21:19:51 +0000 (14:19 -0700)
commit7e7f89933b9d6eba5d298d3f619b5ef4166e5052
tree26e88b6af7f836ab18477db8d3b9954e8c1553af
parent731dcb7680303792315625a86ec0390ca41c03b9
net/http: parse Request-Line in a function, remove an allocation

Removes another per-request allocation. Also makes the code more
readable, IMO. And more testable.

benchmark                                   old ns/op    new ns/op    delta
BenchmarkServerFakeConnWithKeepAliveLite        10539        10324   -2.04%

benchmark                                  old allocs   new allocs    delta
BenchmarkServerFakeConnWithKeepAliveLite           20           19   -5.00%

benchmark                                   old bytes    new bytes    delta
BenchmarkServerFakeConnWithKeepAliveLite         1609         1559   -3.11%

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