[protobuf] Warning messages from compiler

2010-08-17 Thread nirajshr
I am getting the following warning message from the compiler while compiling my program with google protocol buffers using g++ (gcc version 4.1.2 (Red Hat 4.1.2-46)) with a -Wall option. /usr/include/google/protobuf/io/coded_stream.h: In member function 'bool

[protobuf] Performance analysis of RepeatedField versus generated class

2010-08-17 Thread nirajshr
I want to know which of the following implementation is better in terms of performance and usability. Option A is much easier and portable across different protobuf versions. Is it worth the trouble trying to go with Option B? In my tests, I could not find much of a performance gain by using

[protobuf] Can't compile on

2010-08-17 Thread Vali
Hi, I'm trying to compile protobuffers but i'm having some problems at make... Here are some informations about the errors : I run configure with the following parameters and it doesn't show any errors.. bash-3.00$ ./configure CC=/opt/SUNWspro/bin/cc --disable-64bit-solaris checking build

Re: [protobuf] Re: iSeries port

2010-08-17 Thread Henner Zeller
On Mon, Aug 16, 2010 at 17:04, ury ury.se...@gmail.com wrote: Hi, It was EBCDIC vs. ASCII issues. If anyone is interested in iSeries/zSeries porting issues, or protobuf on EBCDIC, I'll be glad to help In particular if you needed to modify the source and have a patch it might be interesting

[protobuf] Adding arrays of doubles (repeated) by passing pointer to the array

2010-08-17 Thread nirajshr
I want to add an array of double to protobuf message object. I already have an array of doubles allocated in my program, and I want to serialize this information. Currently, I am doing this by adding individual elements as follows: for(unsigned i=0; i size; i++) { //

[protobuf] Re: static linking archive of protoc generated *.pb.cc.o files omits some static initializers

2010-08-17 Thread Doug Coburn
OK, I think I found the solution. On Aug 16, 11:40 am, Doug Coburn dougco...@gmail.com wrote: # # Build instructions mkdir generated protoc --cpp_out=./generated *.proto g++ -c generated/base.pb.cc -o

Re: [protobuf] How set initial capacity for repeatable fields (proto java 2.3.0)

2010-08-17 Thread Kenton Varda
No, there is not. Sorry. On Wed, Aug 11, 2010 at 7:44 AM, Prakash Rao prakashrao1...@gmail.comwrote: Hi, I'm trying to find out ways to set initial capacity for my repeatable fields (proto java 2.3.0). I looked at the generated code and it creates an ArrayList but without initial capacity

Re: [protobuf] Importing Protos In Python

2010-08-17 Thread Kenton Varda
On Fri, Aug 13, 2010 at 10:39 AM, Patrick doherty.patr...@gmail.com wrote: import foo_pb2 import bar_pb2 Shouldn't these be: import MyProtos.foo_pb2 import MyProtos.bar_pb2 -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to

Re: [protobuf] Type of fieds

2010-08-17 Thread Kenton Varda
No, sorry. .proto files are intended to be language-neutral, so they cannot depend on code written in a specific language. On Mon, Aug 16, 2010 at 6:50 AM, Peng dupeng...@gmail.com wrote: When we define the type of a filed, it could be Scalar Value Types, Enumerations, and other Message.

Re: [protobuf] What's the right way to bundle Google's code in my project?

2010-08-17 Thread Kenton Varda
You can reuse Google's code under the terms of the New BSD license. See: http://code.google.com/p/protobuf/source/browse/trunk/COPYING.txt The license is extremely permissive. You should provide your code generator as a protoc plugin, so that it may be invoked using the same command as all

Re: [protobuf] Warning messages from compiler

2010-08-17 Thread Kenton Varda
No, the warning is not specific to your system. I believe we fixed these warnings in version 2.3.0 -- maybe you should upgrade? On Tue, Aug 17, 2010 at 7:17 AM, nirajshr niraj...@gmail.com wrote: I am getting the following warning message from the compiler while compiling my program with

Re: [protobuf] Performance analysis of RepeatedField versus generated class

2010-08-17 Thread Kenton Varda
Option B avoids an extra copy of the data. It should work with all versions of protocol buffers. Use it if profiling shows a lot of time spent in this code, otherwise use whichever version you find easier to follow. On Tue, Aug 17, 2010 at 8:51 AM, nirajshr niraj...@gmail.com wrote: I want to

Re: [protobuf] Can't compile on

2010-08-17 Thread Kenton Varda
On Tue, Aug 17, 2010 at 7:18 AM, Vali valentin.adr...@gmail.com wrote: Hi, I'm trying to compile protobuffers but i'm having some problems at make... Here are some informations about the errors : I run configure with the following parameters and it doesn't show any errors.. bash-3.00$

Re: [protobuf] Re: static linking archive of protoc generated *.pb.cc.o files omits some static initializers

2010-08-17 Thread Kenton Varda
Incidentally, my understanding is that the C++ standard says that dynamic initializers only need to be run before the first time the module is accessed (not necessarily before main()). Thus, if your program contains no symbols referring to the module, then it will never be accessed, and dynamic

Re: [protobuf] Performance analysis of RepeatedField versus generated class

2010-08-17 Thread Kenton Varda
BTW On Tue, Aug 17, 2010 at 8:51 AM, nirajshr niraj...@gmail.com wrote: repeated DoubleData bucketDouble = 2; You should declare this field packed: repeated DoubleData bucketDouble = 2 [packed=true]; This will improve efficiency on the wire. -- You received this message because you

Re: [protobuf] Performance analysis of RepeatedField versus generated class

2010-08-17 Thread Daniel Wright
How about this way-more-readable variant of option B: add_double_vector(deal_pb.bucket(i).bucketdouble().data(), deal_pb.bucket(i).bucketdouble().size()); This assumes that add_bouble_vector only needs a const pointer. If it needs a non-const pointer, add the

Re: [protobuf] Scala protocol buffers protoc plugin

2010-08-17 Thread Jeff Plaisance
I agree that defaults should be handled in the library. I have been putting off the issue because i found the interaction between the hasX and getX methods confusing when a default is specified. hasX returns false if x isn't explicitly set, but getX may or may not return a valid value anyway