* export bench=decode-v1 && go test ./util/compression/... \ -run '^$' -bench '^BenchmarkDecode' \ -benchtime 5s -count 6 -cpu 2 -timeout 999m \ | tee ${bench}.txt */
(b *testing.B)
| 173 | | tee ${bench}.txt |
| 174 | */ |
| 175 | func BenchmarkDecode(b *testing.B) { |
| 176 | for _, typ := range Types() { |
| 177 | b.Run(fmt.Sprintf("type=%v", typ), func(b *testing.B) { |
| 178 | var buf DecodeBuffer |
| 179 | res, err := Encode(typ, []byte(compressible), NewConcurrentEncodeBuffer()) |
| 180 | require.NoError(b, err) |
| 181 | |
| 182 | b.ReportAllocs() |
| 183 | b.ResetTimer() |
| 184 | for b.Loop() { |
| 185 | if buf == nil { |
| 186 | buf = NewSyncDecodeBuffer() |
| 187 | } |
| 188 | _, err := Decode(typ, res, buf) |
| 189 | require.NoError(b, err) |
| 190 | } |
| 191 | }) |
| 192 | } |
| 193 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…