Does proto2 support event-based decoding?  That is, is there a parsing
mode that calls user-specified callbacks when it encounters values/
submessages/etc. rather than automatically putting all the data into
an in-memory data structure?  If so, is this supported for both
generated classes and .proto files that are loaded at runtime?

Also, does it support streaming decoding?  That is, can you parse a
partial protobuf (which may or may not end on a record boundary), then
parse more data as more becomes available?

I ask because I'm working on a minimalist C implementation that
specifically targets these use cases.  I'm just curious if proto2
supports these use cases too.

I'm planning to finally release my implementation soon.  It's not
ready yet, but for anyone who wants to check it out, see:

Its niche is:
- minimalism in every regard.  small source code, small object code,
fast to build, etc.
- I don't malloc() or free() in the critical path except where
absolutely necessary (for example, to grow the stack, if the nesting
depth grows beyond its current allocation).
- streaming and event-based decoding.  in other words, it is to
protobufs what SAX is to XML.  this lets people use their own in-
memory representations.  for example, they might want to store
repeated key/value pairs as a map.
- no code generation.  this basically means that the whole API is
built around a reflection-like interface.  I'll optimize this to be as
fast as I can, but probably add a JIT using LLVM or DynASM if there's
still a big performance gap.
- because it's all reflection-based (no code generation, unless you
count the JIT), and yet still (presumably) will have good performance,
it will be a good option for writing bindings for high-level languages
like Python, Ruby, etc.

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to