(b *testing.B)
| 55 | } |
| 56 | |
| 57 | func BenchmarkSnappyDecompress(b *testing.B) { |
| 58 | data := []byte(strings.Repeat("123456789", 1024)) |
| 59 | c := newCompressor() |
| 60 | var buf bytes.Buffer |
| 61 | w, _ := c.Compress(&buf) |
| 62 | _, _ = w.Write(data) |
| 63 | reader := bytes.NewReader(buf.Bytes()) |
| 64 | b.ResetTimer() |
| 65 | for i := 0; i < b.N; i++ { |
| 66 | r, _ := c.Decompress(reader) |
| 67 | _, _ = io.ReadAll(r) |
| 68 | _, _ = reader.Seek(0, io.SeekStart) |
| 69 | } |
| 70 | } |
nothing calls this directly
no test coverage detected