[protobuf] Re: Efficiently reading/writing multiple messages in C++

2010-06-17 Thread Evan Jones
On Jun 17, 2010, at 17:05 , Evan Jones wrote: I'm working around this by moving the CodedInputStream inside my loop, which is fine, but seems sub-optimal. At the very least, since I have lots of small messages, this means my ZeroCopyInputStream's methods get called many times. Based on pre

Re: [protobuf] Re: Efficiently reading/writing multiple messages in C++

2010-06-18 Thread Kenton Varda
You could reconstruct the stream every N bytes, where N << limit. But I doubt there is really much overhead in constructing a new CodedInputStream on the stack for each message. No heap space is allocated in the process. I'd also be amenable to a method which resets the bytes counter. What we r

Re: [protobuf] Re: Efficiently reading/writing multiple messages in C++

2010-06-19 Thread Evan Jones
On Jun 18, 2010, at 17:06 , Kenton Varda wrote: But I doubt there is really much overhead in constructing a new CodedInputStream on the stack for each message. No heap space is allocated in the process. If I end up doing some performance intensive stuff with this code, I'll look into it a