Well, for regular values, it goes <tag> <value>, for a subproto it
goes <tag> <length> <submessage> (which in turn has <tag> <value>
pairs in it). So it depends on the number of fields inside of the
message, and how many bytes it is total. But assuming non-edge-case
conditions, you're probably better off using a submessage and smaller
tag ids (i.e. < 16) than unwinding the repeated (or, indeed, even if
it were a single message). Hm, this also creates an interesting aside,
which is that perhaps it is more efficient to only ever use tag ids <
16 and once you go over that, stick the rest of the fields into a
submessage. It'd make for very confusing code though.
In terms of speed, you end up creating more objects/have recursion
when dealing with submessages, so "loop unrolling" could be effective
there. (By very very small amounts, usually I/O is the limiting
factor.) As always, with such things, benchmark it :)
-ilia
> --
> 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
http://groups.google.com/group/protobuf.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>