(b *testing.B, comp Compressor, input []byte, output *bytes.Buffer)
| 135 | } |
| 136 | |
| 137 | func compressionBenchmark(b *testing.B, comp Compressor, input []byte, output *bytes.Buffer) { |
| 138 | b.Helper() |
| 139 | b.ReportAllocs() |
| 140 | |
| 141 | rdr := bytes.NewReader(input) |
| 142 | |
| 143 | for b.Loop() { |
| 144 | output.Reset() |
| 145 | rdr.Reset(input) |
| 146 | |
| 147 | if err := comp.Compress(output, rdr); err != nil { |
| 148 | b.Fatalf("compression error %v", err) |
| 149 | return |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func decompressionBenchmark(b *testing.B, comp Compressor, input []byte, output *bytes.Buffer) { |
| 155 | b.Helper() |
no test coverage detected