snowflake/common
David Fifield 3df514ae29 Call WriteMessage directly in websocketconn.Conn.Write.
In the client←server direction, this hits a fast path that avoids
allocating a messageWriter.
https://github.com/gorilla/websocket/blob/v1.5.0/conn.go#L760

Cuts the number of allocations in half in the client←server direction:

	$ go test -bench=BenchmarkReadWrite -benchmem -benchtime=5s
	BenchmarkReadWrite/c←s_150-4              597511             13358 ns/op          11.23 MB/s       33709 B/op          2 allocs/op
	BenchmarkReadWrite/s←c_150-4              474176             13756 ns/op          10.90 MB/s       34968 B/op          4 allocs/op
	BenchmarkReadWrite/c←s_3000-4             156488             36290 ns/op          82.67 MB/s       68673 B/op          5 allocs/op
	BenchmarkReadWrite/s←c_3000-4             190897             34719 ns/op          86.41 MB/s       69730 B/op          8 allocs/op
2022-11-16 13:48:34 -07:00
..
amp format using go-1.19 2022-10-09 21:15:50 +02:00
bridgefingerprint Represent Bridge Fingerprint As String 2022-06-16 14:06:58 +01:00
encapsulation format using go-1.19 2022-10-09 21:15:50 +02:00
event Use event logger for proxy starting message and NAT info 2022-11-16 10:08:10 -08:00
ipsetsink Use truncated hash instead crc64 for counted hash 2022-06-16 15:00:12 +01:00
messages format using go-1.19 2022-10-09 21:15:50 +02:00
namematcher Update Relay Pattern format to include dollar sign 2022-06-16 14:06:58 +01:00
nat Wrap client NAT log 2022-05-31 08:52:23 -07:00
safelog format using go-1.19 2022-10-09 21:15:50 +02:00
task Wait some time before displaying the proxy usage log 2022-05-25 11:01:01 -04:00
turbotunnel Increase smux and QueuePacketConn buffer sizes 2021-08-10 15:38:11 -04:00
util Bump version of pion/sdp 2021-01-25 10:28:17 -05:00
utls Don't use entropy for test 2022-06-02 17:24:54 +02:00
websocketconn Call WriteMessage directly in websocketconn.Conn.Write. 2022-11-16 13:48:34 -07:00