Re: [protobuf] Reusing builders. . .

2011-04-24 Thread Pherl Liu
You might want to have a benchmark for this. Allocation in Java is cheap, but would increase the GC costs; resetting builder will introduce some CPU overhead (recursively setting data members and bit masks). On Fri, Apr 22, 2011 at 6:15 AM, David Dabbs dmda...@gmail.com wrote: Hello. I have a

[protobuf] Reusing builders. . .

2011-04-21 Thread David Dabbs
Hello. I have a PB builder I build and write to a stream from a servlet-based webapp thousands of times/second. Something like the following Protos.Response.Builder respBuilder = Protos.Response.newBuilder().setFoo(12).setBar(345); // etc. . . Protos.Response response =