MCPcopy
hub / github.com/gorilla/websocket / BenchmarkWriteNoCompression

Function BenchmarkWriteNoCompression

compression_test.go:44–53  ·  compression_test.go::BenchmarkWriteNoCompression
(b *testing.B)

Source from the content-addressed store, hash-verified

42}
43
44func BenchmarkWriteNoCompression(b *testing.B) {
45 w := ioutil.Discard
46 c := newTestConn(nil, w, false)
47 messages := textMessages(100)
48 b.ResetTimer()
49 for i := 0; i < b.N; i++ {
50 c.WriteMessage(TextMessage, messages[i%len(messages)])
51 }
52 b.ReportAllocs()
53}
54
55func BenchmarkWriteWithCompression(b *testing.B) {
56 w := ioutil.Discard

Callers

nothing calls this directly

Calls 3

newTestConnFunction · 0.85
textMessagesFunction · 0.85
WriteMessageMethod · 0.80

Tested by

no test coverage detected