Re: Java deserialization - any best practices for performances?

2009-07-23 Thread alopecoid
Hi, I haven't actually used the Java protobuf API, but it seems to me from the quick occasional glance that this isn't entirely true. I mean, specifically in response to the code snippet posted in the original message, I would possibly: 1. Reuse the Builder object by calling its clear() method.

Re: Writing a router tha can route messages

2009-07-23 Thread Kaj Bjurman
Thanks Jason, Yes all messages would use the same tag number for the cookie field, and all messages must have that field, but that is all that the router should know, and it must be able to append data to that field. I think I have understood what to do now, and thanks for the tip about where

Re: Writing a router tha can route messages

2009-07-23 Thread Kaj Bjurman
Thanks. On 16 Juli, 00:43, Kenton Varda ken...@google.com wrote: On Wed, Jul 15, 2009 at 10:56 AM, jasonh jas...@google.com wrote: Foo f = Foo.newBuilder().mergeFrom(...).setCookie(newCookieVal).build (); There's actually a shortcut for this:  the toBuilder() method of the Message

Re: Compiling on AIX 5.3 using xlC 3.55 compiler

2009-07-23 Thread Kenton Varda
It looks like unordered_map or unordered_set is not behaving correctly (e.g. not finding matching keys when they are present) but I can't really tell just from that output. On Mon, Jul 20, 2009 at 11:53 AM, vikram patilvik...@gmail.com wrote: In previous attempt small test worked but was not

Re: Java deserialization - any best practices for performances?

2009-07-23 Thread Kenton Varda
On Thu, Jul 23, 2009 at 12:32 AM, alopecoid alopec...@gmail.com wrote: Hi, I haven't actually used the Java protobuf API, but it seems to me from the quick occasional glance that this isn't entirely true. I mean, specifically in response to the code snippet posted in the original message,

Re: Java deserialization - any best practices for performances?

2009-07-23 Thread alopecoid
Hi Kenton, Thanks for your reply. You can't continue to use a Builder after calling build(). Even if we made it so you could, it would be building an entirely new object, not reusing the old one. We can't make it reuse the old one because that would break the immutability guarantee of