When using protobuf , there comes the performance bottleneck. Then I found the hot point is focus on GeneratedMessageReflection::ListFields (which costs 30%+ CPU idle) by gprofiler, which indicates that there is too much "new" and "delete" .
------------------------API of ListFields--------------------------------- void GeneratedMessageReflection::ListFields( const Message& message, vector<const FieldDescriptor*>* output) const; --------------------------------------------------------------------------------- As the function called, the second arg : "output" is always a empty vector. So it will cause new/delete for many times in case of plenty fields So as title mentioned, Why don't we use deque or other container to avoid too much new/delte, instead of using vector. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/AhsFq2N6IxEJ. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.