Skip to content

Perf: Profile-based buffer options generation should be based on average message size estimation #132

@mempirate

Description

@mempirate

Context

In #131, we introduced Profile, which is an enum representing different performance profiles ((Throughput, Latency, Balanced)). These performance profiles are now just used to set buffer size and buffer linger options to some reasonable values.

To make them maximally useful though, they should take into account an optional estimation of the message side that the caller can provide, primarily to tune the buffer size. If your average message size is many multiples greater than the Throughput profile buffer size, the socket driver will still have to make a lot of syscalls just to write your message to the underlying socket. We should try to minimize these syscalls because they're expensive.

So, a buffer size tuned to message size could be the highest multiple of 2 that is still smaller than the estimated message size.

More context:
#131 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions