On Wed, Oct 7, 2009 at 5:46 AM, villintehaspam <villintehas...@gmail.com>wrote:

> I am wondering about the best way of forwarding received protocol
> buffer messages from one entity to another without having to parse the
> entire message just to serialize it again.
>

It looks like you've figured out all the major options.

One thing I'd encourage you to do if you haven't already is actually profile
your system to find out if repeated parsing and serialization is a real
problem for you.  It may not be a real problem in practice even if it feels
wrong.


> Of these three options, I'm thinking that option 3 is the correct way

to go.


All three options are reasonable.  Option 3 is the most complicated
solution, but probably the most performant.


> Am I missing some functionality provided by protocol buffers
> (such as the ability to skip parsing extensions even if they are
> recognized or similar or only parse as much as needed)? Am I missing
> any problems?
>

If you are using C++, then all compiled-in extensions will be eagerly
parsed.  If you only compile-in the extensions that each process actually
cares about, that solves your problem.

In Java you provide an ExtensionRegistry listing extensions you care about,
so it's trivial to include only the ones you want.  I'm guessing you aren't
using Java.


> On a somewhat related note, is it possible to parse a partially
> transmitted message and continue parsing at a later time when more
> data is available?


Not without blocking.  The library is designed to parse an entire message at
once.  Allowing partial parsing (without blocking) would be quite
complicated.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to