proto 2 vs proto 3 implications

5,773 views
Skip to first unread message

William Cheung

unread,
Jun 7, 2017, 9:35:16 PM6/7/17
to Protocol Buffers
Hi everyone,

I've just started with protobuf.

I've noticed that using proto3 means that if you set a parameter with default values (e.g. bool false) it is no longer serialised. For my application, sending the default value conveys information, so this is unacceptable as the deserialiser does not know that the variable was set. I noticed that proto 2 has a 'optional' keyword which seems to do what I want. I also found a work around in proto 3 in the link below but it is really ugly.


My questions are

What is the long term support plan for proto 2? Will it be abandoned by google in the future?
What would be computationally more efficient, using proto 2 or using proto 3 with the work around?

Thanks

Bo Yang

unread,
Jun 8, 2017, 3:22:36 PM6/8/17
to William Cheung, Protocol Buffers
I don't think proto3 will replace proto2. You should use the proper one for your scenario.
There is few difference in computational efficiency in this case.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages