protobuf
protobuf copied to clipboard
growslice issue
When using proto repeated type field, I encounter the growslice performance issue as call unmarshal function. Do we have a initilize method to pre allocate slice size for a repeated fields.
here is the schema
message User_Data_Record {
message KVR {
}
message NPSegment {
repeated KVR kv = 1; /// this filed encoutner the growslice performance issue
}
repeated NPSegment segments = 1;
}
any one can help?
Can you upload example and benchmarks? Thanks