Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
groot/internal/httpio: add a pool of http.Request
This CL adds a pool of http.Request to alleviate somewhat the memory pressure of cloning those when requesting new chunks of data from the HTTP server. old: reading remote file after having downloaded to a local one new: reading remote file w/ httpio + sync.Pool ``` name old time/op new time/op delta DumpHTTP/delay-0s-8 279ms ± 1% 287ms ± 2% +3.09% (p=0.000 n=27+29) DumpHTTP/delay-5ms-8 279ms ± 2% 288ms ± 2% +3.06% (p=0.000 n=29+29) DumpHTTP/delay-10ms-8 281ms ± 3% 287ms ± 1% +2.24% (p=0.000 n=26+30) DumpHTTP/delay-100ms-8 286ms ± 3% 288ms ± 1% +0.45% (p=0.032 n=25+29) name old alloc/op new alloc/op delta DumpHTTP/delay-0s-8 156MB ± 0% 159MB ± 0% +1.93% (p=0.000 n=29+30) DumpHTTP/delay-5ms-8 156MB ± 0% 159MB ± 0% +1.95% (p=0.000 n=30+30) DumpHTTP/delay-10ms-8 155MB ± 0% 159MB ± 0% +1.95% (p=0.000 n=30+30) DumpHTTP/delay-100ms-8 155MB ± 0% 159MB ± 0% +1.99% (p=0.000 n=30+28) name old allocs/op new allocs/op delta DumpHTTP/delay-0s-8 81.4k ± 0% 117.6k ± 0% +44.46% (p=0.000 n=30+30) DumpHTTP/delay-5ms-8 81.4k ± 0% 117.6k ± 0% +44.48% (p=0.000 n=30+30) DumpHTTP/delay-10ms-8 81.4k ± 0% 117.5k ± 0% +44.48% (p=0.000 n=29+30) DumpHTTP/delay-100ms-8 81.4k ± 0% 117.6k ± 0% +44.51% (p=0.000 n=30+29) ``` Fixes #142.
- Loading branch information