(b *testing.B)
| 34 | } |
| 35 | |
| 36 | func BenchmarkNewBufferPool2(b *testing.B) { |
| 37 | var pool = utils.NewBufferPool() |
| 38 | var data = []byte(strings.Repeat("Hello", 1024)) |
| 39 | |
| 40 | b.RunParallel(func(pb *testing.PB) { |
| 41 | for pb.Next() { |
| 42 | var buffer = pool.Get() |
| 43 | buffer.Write(data) |
| 44 | pool.Put(buffer) |
| 45 | } |
| 46 | }) |
| 47 | } |
| 48 | |
| 49 | func BenchmarkNewBufferPool3(b *testing.B) { |
| 50 | var pool = utils.NewBufferPool() |
nothing calls this directly
no test coverage detected