func BenchmarkSliceRead10(b *testing.B) { var data [10]byte for i := 0; i < b.N; i++ { b := Slice(data[:]) for { if _, err := b.ReadByte(); err != nil { break } } } }
func BenchmarkBytesBufferRead10(b *testing.B) { var data [10]byte for i := 0; i < b.N; i++ { b := bytes.NewBuffer(data[:]) for { if _, err := b.ReadByte(); err != nil { break } } } }
func BenchmarkBytesReader1k(b *testing.B) { var data [1000]byte for i := 0; i < b.N; i++ { b := bytes.NewReader(data[:]) for { if _, err := b.ReadByte(); err != nil { break } } } }