Initial implementation

This commit is contained in:
Aliaksandr Valialkin
2016-06-22 19:36:29 +03:00
commit 21bf76e6cc
10 changed files with 324 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package bytebufferpool
import (
"bytes"
"testing"
)
func BenchmarkByteBufferWrite(b *testing.B) {
s := []byte("foobarbaz")
b.RunParallel(func(pb *testing.PB) {
var buf ByteBuffer
for pb.Next() {
for i := 0; i < 100; i++ {
buf.Write(s)
}
buf.Reset()
}
})
}
func BenchmarkBytesBufferWrite(b *testing.B) {
s := []byte("foobarbaz")
b.RunParallel(func(pb *testing.PB) {
var buf bytes.Buffer
for pb.Next() {
for i := 0; i < 100; i++ {
buf.Write(s)
}
buf.Reset()
}
})
}