Ok, this is a simple example of proto buffers file. I want to write 1000 "Records". Each record has its name and "NamedArray"
Each array has its name and a set of double numbers, For my example, I've filled array with 10 000 numbers for all 1000 Records. There are 2 things you will see: 1) After event 500, even 200MB memory is not enough. 2) It's slower by factor ~5 compare to the java serialization with the compression. 3) File size is very large. I do not know how to fill compressed recorsd on fly using this package. Finally, there is no even sensible approach to append new "Records" to the existing file (without "merge", which in fact has to parse the existing file first!) So, I do not see any superiority of Protocol Buffers compare to use file formats, it's actually much worst as it come to such situations.. ****************************************************** // orginize in repeated records message Record { optional string name = 1; message NamedArray { required string name=1 [default = "none"]; repeated double value=2 [packed=true]; } optional NamedArray array = 2; message PBuffer { repeated Record record = 1; } ************************************************ On Oct 8, 11:33 am, Henner Zeller <h.zel...@acm.org> wrote: > Hi, > > > This is exactly what I've done before putting arrays into a string. > > When I've implemented arrays via repeated fields, the program was > > even slower, > > and the file size was too large (compare to Java serialization > > mechanism+ zip). > > If you put the values in a string and do you own array management on > top as compared to using a repeated field with packed option, there > should not be a significant difference because it is essentially the > same. > Protobufs don't come with a compression, so if you compare the sizes, > you need to compare compressed Java serialization with compressed > proto serialization. > > If you provide an example of what you want to do and what are your > current solutions you compare, people on this list might be able to > help. > > -h --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---