Skip to content

Secret Connection: Remove sync.Pool, and put those buffers in the connection struct #3197

@ValarDragon

Description

@ValarDragon

Feature Request

Summary

In secret connection we use sync.Pool's for some 1024 byte buffers. However these buffers are only ever needed locally within the same thread, so this is a wasted synchronization primitive that does cost us. All reads and writes in secret connection are under a mutex, so we should just make a new buffer in each secret conn struct.

Impact is ~8% of the current secret connection read time (Get and Put in following pprof):
image

Problem Definition

Slight speedup to secret conn

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions