Re: More readable/compact text format for repeated.
FWIW, I think using square brackets for the array output would make your example look more natural (and could be visual compatible with things like json) indices { index: [ 15, 1, 65, 44, 2, 78 ] } On Fri, Apr 3, 2009 at 5:25 AM, wrote: > > Hi, > > I'm currently using protocol buffers files in text format. While it's > a very easy format to use and understand I think it's need more > flexibility. > > For example if I want to define a structure for a index array I have > to do this : > > // definitions > message IndexArray { > repeated int32 index = 1; > } > > message SomeStruct { > optional IndexArray indices = 1; > } > > > // data in text format > indices { > index: 15 > index: 1 > index: 65 > index: 44 > index: 2 > index: 78 > ... > } > > As you can see 'index' is repeated as many times as you need a single > value. > What I would like is something like this : > > // data in text format > indices { > index: { 15, 1, 65, 44, 2, 78, ... } > } > > The compact format would be defined in some way like this : > > // definition > message IndexArray { > repeatedarray int32 index = 1 [separator = ","]; > } > > I still don't know repeatedarray would work with message data > > (Sorry for my english) > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Protocol Buffers Vs. XML Fast Infoset
On Fri, Apr 3, 2009 at 2:40 AM, ShirishKul wrote: > I found that for a typical data to be transferred across the wire for > size of 500KB that a XML file would represent has corresponding file > size as 300KB for PB binary and around 130KB for XML Fast Infoset > binary file. What kind of data were you encoding? I'm guessing you enabled some kind of compression for the FI encoding? Note that protocol buffers, while compact, do not actually apply any sort of compression themselves. For repetitive data or data containing a lot of text strings, applying zlib compression to the encoded message can make it much smaller. > Timings to parsing and serializing is extremely good for Protocol > buffers. :) (Don't forget to use optimize_for = SPEED if performance is important -- this will be the default in the next version.) What makes a difference if we consider XML fast infoset binary against > PB binary in terms for Sizes, speed to parse them up etc.? I don't actually know much about FI. My guess based on reading some descriptions of FI is that PB is similar to FI's non-self-describing, no-compression mode. I would also guess that because XML is a much more complicated format than protocol buffers, FI probably has more overhead when encoding simple structured data, especially number-heavy data. For string-heavy data, though, XML works pretty well and so this overhead may not be an issue in that 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 -~--~~~~--~~--~--~---
Re: More readable/compact text format for repeated.
You can easily implement your own text format by writing code based on protobuf reflection. In fact, the official TextFormat class is based on reflection. So take a look at the code for the TextFormat class and write something like that with whatever modifications you need. On Fri, Apr 3, 2009 at 5:25 AM, wrote: > > Hi, > > I'm currently using protocol buffers files in text format. While it's > a very easy format to use and understand I think it's need more > flexibility. > > For example if I want to define a structure for a index array I have > to do this : > > // definitions > message IndexArray { >repeated int32 index = 1; > } > > message SomeStruct { >optional IndexArray indices = 1; > } > > > // data in text format > indices { >index: 15 >index: 1 >index: 65 >index: 44 >index: 2 >index: 78 >... > } > > As you can see 'index' is repeated as many times as you need a single > value. > What I would like is something like this : > > // data in text format > indices { >index: { 15, 1, 65, 44, 2, 78, ... } > } > > The compact format would be defined in some way like this : > > // definition > message IndexArray { >repeatedarray int32 index = 1 [separator = ","]; > } > > I still don't know repeatedarray would work with message data > > (Sorry for my english) > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Platforms supported for C++ gen code
On Fri, Apr 3, 2009 at 2:18 AM, Shirish Kulkarni wrote: > Can I suppose it could be well ported to - say 64-bit AIX - platform as > well? > I would imagine so. It may even work without modification, especially if you use GCC as the compiler. > What charsets does Protocol Buffers support. (Sorry, I was not able to > find these information anywhere in the PB documentation) > The "string" type in protocol buffers is UTF-8. You can also use the "bytes" type to pass arbitrary bytes in which you can use whatever character set you want. > > On Fri, Apr 3, 2009 at 11:38 AM, Shirish Kulkarni wrote: > >> Thanks Kenton. >> >> >> On Fri, Apr 3, 2009 at 12:18 AM, Kenton Varda wrote: >> >>> Most Unix-like platforms (Linux, Mac OSX, FreeBSD, Solaris, Cygwin, etc.) >>> and Windows (MinGW, MSVC) are supported. libprotobuf does not use many >>> OS-specific features so it's likely to be easy to port to other platforms. >>> However, it is not well-designed for stripped-down embedded systems with >>> limited memory; consider protobuf-c for them. >>> >>> On Wed, Apr 1, 2009 at 11:42 PM, ShirishKul wrote: >>> I would like to know about the platforms that Protocol Buffers support for C++ generated code. Please let me know. Thanks, Shirish >>> >> > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Protobuf-net Serialize problem
Marc, The server is using ProtoBuf 2.0.1. I had to upgrade my .net version to the latest protobuf-net in order to have protogen work with optional fields correctly. It seems that the server only processes bytes up to the 1st NULL char when calling ParseFromString. Will this problem be avoided with Base64? Thanks On Apr 2, 5:52 pm, Marc Gravell wrote: > (re last post) > > As with unicode, you can't use ASCII to handle raw binary; either use > base-64 (previous post), or send binary. > > Marc --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
More readable/compact text format for repeated.
Hi, I'm currently using protocol buffers files in text format. While it's a very easy format to use and understand I think it's need more flexibility. For example if I want to define a structure for a index array I have to do this : // definitions message IndexArray { repeated int32 index = 1; } message SomeStruct { optional IndexArray indices = 1; } // data in text format indices { index: 15 index: 1 index: 65 index: 44 index: 2 index: 78 ... } As you can see 'index' is repeated as many times as you need a single value. What I would like is something like this : // data in text format indices { index: { 15, 1, 65, 44, 2, 78, ... } } The compact format would be defined in some way like this : // definition message IndexArray { repeatedarray int32 index = 1 [separator = ","]; } I still don't know repeatedarray would work with message data (Sorry for my english) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Protocol Buffers Vs. XML Fast Infoset
Kenton, I worked to see the difference between the *XML fast infoset* and the *Protocol Buffers* (although I'm not aware about what are internal things happening therein). I found that for a typical data to be transferred across the wire for size of 500KB that a XML file would represent has corresponding file size as 300KB for PB binary and around 130KB for XML Fast Infoset binary file. Timings to parsing and serializing is extremely good for Protocol buffers. What makes a difference if we consider XML fast infoset binary against PB binary in terms for Sizes, speed to parse them up etc.? Regards, Shirish --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Platforms supported for C++ gen code
Can I suppose it could be well ported to - say 64-bit AIX - platform as well? What charsets does Protocol Buffers support. (Sorry, I was not able to find these information anywhere in the PB documentation) On Fri, Apr 3, 2009 at 11:38 AM, Shirish Kulkarni wrote: > Thanks Kenton. > > > On Fri, Apr 3, 2009 at 12:18 AM, Kenton Varda wrote: > >> Most Unix-like platforms (Linux, Mac OSX, FreeBSD, Solaris, Cygwin, etc.) >> and Windows (MinGW, MSVC) are supported. libprotobuf does not use many >> OS-specific features so it's likely to be easy to port to other platforms. >> However, it is not well-designed for stripped-down embedded systems with >> limited memory; consider protobuf-c for them. >> >> On Wed, Apr 1, 2009 at 11:42 PM, ShirishKul wrote: >> >>> >>> I would like to know about the platforms that Protocol Buffers support >>> for C++ generated code. >>> >>> Please let me know. >>> >>> Thanks, >>> Shirish >>> >>> >>> >> > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---