• Brad Fitzpatrick's avatar
    net/http: reuse textproto.Readers; remove 2 more allocations · 1b0d04b8
    Brad Fitzpatrick authored
    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
    1b0d04b8
request.go 23.3 KB