Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-15 Thread Henner Zeller
On Tue, Mar 15, 2011 at 10:09, Samvel Khalatyan wrote: > Thanks for the clarification. Does it mean that my code should look like the > example below? > fstream in("10_GB_file.pb", ios::in | ios::binary); > bool continue_reading = true > while(continue_reading) > { >   ::google::protobuf::io::Istr

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-15 Thread Samvel Khalatyan
Thanks for the clarification. Does it mean that my code should look like the example below? fstream in("10_GB_file.pb", ios::in | ios::binary); bool continue_reading = true while(continue_reading) { ::google::protobuf::io::IstreamInputStream raw_in(&in); ::google::protobuf::io::CodedInputStre

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-15 Thread Henner Zeller
On Tue, Mar 15, 2011 at 06:05, ksamdev wrote: > I like the interest in the topic. > I've put 1GB to emphasize that the use case is safe. In fact, I save > messages in file in next way: > XYXYXYXYXY. > where X is the size of the message and Y is the message itself. Each message > is read in the

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-15 Thread ksamdev
I like the interest in the topic. I've put 1GB to emphasize that the use case is safe. In fact, I save messages in file in next way: XYXYXYXYXY. where X is the size of the message and Y is the message itself. Each message is read in the loop and overwritten. Clearly, I do *not* read the w

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-14 Thread Henner Zeller
On Mon, Mar 14, 2011 at 10:34, ksamdev wrote: > Thanks for a quick reply. > Honestly, I fill a set of histograms for each event. I've added this feature > only recently and have a version of the code without histograms. > Here is the same performance measurement without histograms: > READING > ===

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-14 Thread ksamdev
btw, ProtoBuf is really fast and easy to use. I like it. -- 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...@goog

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-14 Thread ksamdev
I've added the synched cout wrapper and fixed C "float" function use. Eventually code started working as expected, for example, in cast of 8 cores computer the performance measurements are: Generate 20 files with 10 events in each WRITING === Generate ProtoBuf real 0m15.608s user 0m6.

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-14 Thread ksamdev
Thanks for a quick reply. Honestly, I fill a set of histograms for each event. I've added this feature only recently and have a version of the code without histograms. Here is the same performance measurement without histograms: READING === Read ProtoBuf Processed events: 100 real 0m2

Re: [protobuf] ProtoBuf and Multi-Threads

2011-03-14 Thread Henner Zeller
On Mon, Mar 14, 2011 at 10:08, ksamdev wrote: > Hi, > I have a large set of files with a number of the same type messages saved. > My code reads messages in a sequence from these files one after another. > I've measured time (with terminal "time" command) of running the code, and > get something l

[protobuf] ProtoBuf and Multi-Threads

2011-03-14 Thread ksamdev
Hi, I have a large set of files with a number of the same type messages saved. My code reads messages in a sequence from these files one after another. I've measured time (with terminal "time" command) of running the code, and get something like: READING === Read ProtoBuf Processed events