On Tue, Jul 19, 2016 at 7:38 AM, Mohamed Koubaa <mohamed.kou...@ansys.com>
wrote:

> Hello,
>
> In my cpp proto3 project I am using enums that are wrapped in messages to
> avoid namespace collisions.  See for example:
>
> message Physics {
>   enum Enum {
>      STRUCTURAL = 0;
>      THERMAL = 1;
>   }
> }
>
> In c++ I can refer to it by Physics::STRUCTURAL which is great.
>
> In this case, the Physics message does not have any fields. It derives
> from google::protobuf::Message or MessageLite and has some generated
> methods that are not relevant.  In a project with several thousand enums,
> this could create binary bloat when compiled.
>
Have you measured the binary size impact of these generated classes?


>
> Does it make sense for protoc to identify messages that are simply there
> to wrap enums and provide a lighter api for it?
>
Even for an empty message, protoc has to generate the parsing/serialization
methods because passing empty messages in RPC is a valid use case and the
empty message may be extended to be not empty later.



> Or more generally to identify messages that do not have fields and derive
> from something even smaller than MessageLite?
>
> Thanks,
> Mohamed Koubaa
> Software Developer
> Ansys Inc
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to