You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current encoding process generates a large amount of memory allocation, and the GC pressure will increase when the QPS becomes large. Consider reducing the number of memory allocations to optimize the encoding process.
Here is my proposal:
Modify the BinaryEncoder interface definition
type BinaryEncoder interface {
Encode(s *Stream)
}
Reduce NewBuffer calls by stitching each field encoding result directly through Stream. the Stream definition is as follows:
The current encoding process generates a large amount of memory allocation, and the GC pressure will increase when the QPS becomes large. Consider reducing the number of memory allocations to optimize the encoding process.
Here is my proposal:
BinaryEncoder
interface definitionReduce
NewBuffer
calls by stitching each field encoding result directly throughStream
. theStream
definition is as follows:Stream
implements theWriteXxx
method from the originalBuffer
.Encode
methods of all types that implement theBinaryEncoder
interface require only minor modifications, such asDataValue
:For detailed implementation, please refer to #726
The text was updated successfully, but these errors were encountered: