On Fri, Jul 30, 2010 at 3:47 AM, David <david.kum...@gmail.com> wrote:
> Hi all, I was finally able to write protocol buffers code over REST > and did some comparison with XStream which we are currently uses. > Everything seems great, only stumble with one thing. > > We have very large messages in one particular attributes, say > something like this > > message Data { > optional string datavalue=1; > } > Datavalue above are extremely huge text messages. Size is 512kb - 5 > Mb. > > Protocol buffers deserialize just fine, with superb performance > comparing to XStream. However, I notice when I send this message to > wire (via REST), it took longer to get response. Always twice longer > than XStream. I am thinking this might come from serializing time. > It might be something to do with the utf8 serialization of the string. There are two sets of byte arrays that need to be utf-encoded upon serializing your message (costly especially for large strings like what you have). Try changing the field to ByteString. (optional bytes datavalue=1) > From google documents, it says Protocol buffers is not designed to > handle very large messages, although it can handle very large data > set. > > I was wondering if anyone has some opinion or maybe solution from my > case above? > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to proto...@googlegroups.com. > To unsubscribe from this group, send email to > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- When the cat is away, the mouse is alone. - David Yu -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@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.