MCPcopy
hub / github.com/coder/websocket / BenchmarkFlateWriter

Function BenchmarkFlateWriter

compress_test.go:43–51  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

41}
42
43func BenchmarkFlateWriter(b *testing.B) {
44 b.ReportAllocs()
45 for i := 0; i < b.N; i++ {
46 w, _ := flate.NewWriter(io.Discard, flate.BestSpeed)
47 // We have to write a byte to get the writer to allocate to its full extent.
48 w.Write([]byte{'a'})
49 w.Flush()
50 }
51}
52
53func BenchmarkFlateReader(b *testing.B) {
54 b.ReportAllocs()

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…