Open
Description
openedon Aug 30, 2021
Documentation says:
MarshalToVT() ... This function is useful e.g. when using memory pooling to re-use serialization buffers.
Could you please provide clarification on how to use it? I'm asking because protobufs are typically used with gRPC, and grpc-go's SendMsg() returns before the buffer gets put on the wire. Hence, you cannot reuse it. Here is a relevant issue: grpc/grpc-go#2159. Someone has even attempted this http://www.golangdevops.com/2019/12/31/autopool/ but it's not a solution and the finalizers have poor performance. You could find even more details here thanos-io/thanos#4609.
Are there any examples of the usage of this function? I couldn't find anything.
If I am correct then the recommendation in the README seems dangerous.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels