I'm noticing a large spikes in heap allocs and GC time when message write volume is high.
My profiles lead me towards flate.NewWriter() in compressNoContextTakeover().
I believe this is causing an allocation of a new sliding window (32k?) for each compressed write. This seems avoidable if the writers are recycled via flate.Writer.Reset().
Probably should be statically allocating the flate writer per connection and also provide an option to get flate writers from a sync.pool.