(b *testing.B)
| 6 | ) |
| 7 | |
| 8 | func BenchmarkByteBufferWrite(b *testing.B) { |
| 9 | s := []byte("foobarbaz") |
| 10 | b.RunParallel(func(pb *testing.PB) { |
| 11 | var buf ByteBuffer |
| 12 | for pb.Next() { |
| 13 | for i := 0; i < 100; i++ { |
| 14 | buf.Write(s) |
| 15 | } |
| 16 | buf.Reset() |
| 17 | } |
| 18 | }) |
| 19 | } |
| 20 | |
| 21 | func BenchmarkBytesBufferWrite(b *testing.B) { |
| 22 | s := []byte("foobarbaz") |