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 100000 events in each

WRITING
=======

Generate ProtoBuf

real 0m15.608s
user 0m6.582s
sys 0m1.383s

READING
=======

Read ProtoBuf
Processed events: 2000000

real 0m6.992s
user 0m6.393s
sys 0m0.534s

READING (MULTITHREADS)
=====================

8: data_1.pb
7: data_10.pb
6: data_11.pb
5: data_12.pb
4: data_13.pb
3: data_14.pb
2: data_15.pb
1: data_16.pb
7: data_17.pb
5: data_18.pb
4: data_19.pb
6: data_2.pb
8: data_20.pb
1: data_3.pb
3: data_4.pb
5: data_5.pb
7: data_6.pb
6: data_7.pb
8: data_8.pb
1: data_9.pb
Thread read 200000 events
Thread read 100000 events
Thread read 200000 events
Thread read 300000 events
Thread read 300000 events
Thread read 300000 events
Thread read 300000 events
Thread read 300000 events

real 0m1.527s
user 0m7.877s
sys 0m0.432s

So, reading is ~4.66 times faster in the multi-threads case.

-- 
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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to