protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

growslice issue

Open linchuan4028 opened this issue 4 years ago • 2 comments

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;
   
}

linchuan4028 avatar Sep 27 '20 09:09 linchuan4028

any one can help?

linchuan4028 avatar Oct 09 '20 06:10 linchuan4028

Can you upload example and benchmarks? Thanks

AllenX2018 avatar Nov 28 '20 07:11 AllenX2018