MCPcopy
hub / github.com/kopia/kopia / decompressionBenchmark

Function decompressionBenchmark

repo/compression/compressor_test.go:154–170  ·  view source on GitHub ↗
(b *testing.B, comp Compressor, input []byte, output *bytes.Buffer)

Source from the content-addressed store, hash-verified

152}
153
154func decompressionBenchmark(b *testing.B, comp Compressor, input []byte, output *bytes.Buffer) {
155 b.Helper()
156 b.ReportAllocs()
157
158 rdr := bytes.NewReader(input)
159
160 for b.Loop() {
161 output.Reset()
162
163 rdr.Reset(input)
164
165 if err := comp.Decompress(output, rdr, true); err != nil {
166 b.Fatalf("compression error %v", err)
167 return
168 }
169 }
170}

Callers 1

BenchmarkCompressorFunction · 0.85

Calls 4

HelperMethod · 0.80
FatalfMethod · 0.80
ResetMethod · 0.65
DecompressMethod · 0.65

Tested by

no test coverage detected