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

Function BenchmarkFlateReader

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

Source from the content-addressed store, hash-verified

51}
52
53func BenchmarkFlateReader(b *testing.B) {
54 b.ReportAllocs()
55
56 var buf bytes.Buffer
57 w, _ := flate.NewWriter(&buf, flate.BestSpeed)
58 w.Write([]byte{'a'})
59 w.Flush()
60
61 for i := 0; i < b.N; i++ {
62 r := flate.NewReader(bytes.NewReader(buf.Bytes()))
63 io.ReadAll(r)
64 }
65}
66
67// TestWriteSingleFrameCompressed verifies that Conn.Write sends compressed
68// messages in a single frame instead of multiple frames, and that messages

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…