Re: [protobuf] protocol buffers performance

222 views
Skip to first unread message

kira kk

unread,
Jan 24, 2013, 10:18:46 PM1/24/13
to Marc Gravell, prot...@googlegroups.com
Thanks Marc. Before I run some trial tests. May you advise some benefit of using protocal buffer instead of a collection of primitive data type.

Kira 


On 24 January 2013 15:40, Marc Gravell <marc.g...@gmail.com> wrote:
Exact performance is very implementation- / application-specific. Yes, protobuf will be fast - but probably not quite as fast as a raw memcpy. But if you want *actual* numbers, the best thing to do would be to measure it on the sort of data you want to work with.

Marc


On 24 January 2013 03:44, kira kk <kir...@gmail.com> wrote:
Hi,

I am considering to adopt protocol buffer in c++. However, I cannot find there is any performance about it.
Here is my situation: the applications are distributed and performance-critical C++ applications. Each application communicates through message by socket.
So the message is serialize to a buffer and publish it. Currently memcpy is used for serialization as these messages are just a collection of C++ primitive data type 
and char array. So I don't know if it is suitable to switch to use protocol buffer. Any suggestion is appreciated!

Regards,
Kira

--
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/-/0uFenUWso_MJ.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.



--
Regards,

Marc

Feng Xiao

unread,
Jan 25, 2013, 12:58:48 AM1/25/13
to prot...@googlegroups.com, Marc Gravell

On Friday, January 25, 2013 11:18:46 AM UTC+8, kira kk wrote:
Thanks Marc. Before I run some trial tests. May you advise some benefit of using protocal buffer instead of a collection of primitive data type.
To name some of the benefits (over using primitive data types):
  1. Backward compatibility: After you add more data fields to the message (which is very likely when your system is evolving), a server with the new message definition will still be able to recognize the data from an old server. Some sort of forward compatibility is also provided. An old server can recognized the data from a new server with newly added fields treated as unknown fields.
  2. Language neutral and platform neutral: There are protobuf implementations for many other languages besides C++. They share the same wire format, so you can read the data in any other language as you like. This is very useful in some cases (e.g., communication between servers written in different languages, writing a tool in python for data analysis, etc).
  3. Rich feature set: Various wire types, repeated fields, text format, extensions, reflection...
Reply all
Reply to author
Forward
0 new messages