Descriptionioutil: remove discard pool. Now stack allocated.
With a small benchmark:
func BenchmarkDiscard(b *testing.B) {
b.StopTimer()
buf := make([]byte, 1e9)
for i := 0; i < b.N; i++ {
b.StopTimer()
r := bytes.NewReader(buf)
b.StartTimer()
io.Copy(Discard, r)
}
}
before:
BenchmarkDiscard 50000 58.7 ns/op 0 B/op 0 allocs/op
after:
BenchmarkDiscard 50000 56.5 ns/op 0 B/op 0 allocs/op
Patch Set 1 #Patch Set 2 : diff -r 7abe32ccffb1 https://code.google.com/p/go #Patch Set 3 : diff -r 7abe32ccffb1 https://code.google.com/p/go #
Total comments: 1
MessagesTotal messages: 8
|