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

    const 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 
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to