Descriptionbufio: make Reader buffer transient
Share garbage between different bufio Readers. When a Reader
has zero buffered data, put its buffer into a pool.
This acknowledges that most bufio.Readers eventually get
read to completion, and their buffers are then no longer
needed.
benchmark old ns/op new ns/op delta
BenchmarkReaderEmpty 2993 1058 -64.65%
benchmark old allocs new allocs delta
BenchmarkReaderEmpty 3 2 -33.33%
benchmark old bytes new bytes delta
BenchmarkReaderEmpty 4278 133 -96.89%
Update Issue 5100
Patch Set 1 #Patch Set 2 : diff -r 2489327864d7 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 2489327864d7 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r 30c566874b83 https://go.googlecode.com/hg/ #
Total comments: 6
Patch Set 5 : diff -r 8f1fb6b6f141 https://go.googlecode.com/hg/ #
Total comments: 12
Patch Set 6 : diff -r 4cb93e2900d0 https://go.googlecode.com/hg/ #Patch Set 7 : diff -r 43b3233f0b5b https://go.googlecode.com/hg/ #MessagesTotal messages: 13
|