Skip to content

substantial GC overhead with per message deflate compression #193

@y3llowcake

Description

@y3llowcake

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions