Reading from a stream...

2009-03-18 Thread sauternes
I've read the various useful posts on this discussion group about using popLimit() and pushLimit() to control how many bytes are read at a time when using a CodedInputStream, but is there an elegant way of detecting EOF/end of stream or is it simply a question of waiting for an exception to be

Re: Reading from a stream...

2009-03-18 Thread Kenton Varda
On Wed, Mar 18, 2009 at 8:31 AM, sauternes hossein.gho...@gmail.com wrote: I've read the various useful posts on this discussion group about using popLimit() and pushLimit() to control how many bytes are read at a time when using a CodedInputStream, but is there an elegant way of detecting

Serialization time in C++ using protobuf

2009-03-18 Thread ShirishKul
I used protobuf to serialize an object in C++. The size of binary was around 300 KB and time taken was 1359.4098 milliseconds. I wonder why it took so much of time at C++ , where as, at java side - serialization of similar object took 39.62626263 milliseconds. I've seen SerializeToOSteam took

Re: Serialization time in C++ using protobuf

2009-03-18 Thread Kenton Varda
First, are you using: option optimize_for = SPEED; ? If not, add that line to your .proto file. But even without that option, the speed shouldn't be that slow. Maybe you can run in a profiler to see what's taking so long? Are you writing to an in-memory buffer or some sort of output stream?