On Dec 5, 2008, at 10:29 AM, Henning P. Schmiedehausen wrote:
[EMAIL PROTECTED] writes:
Author: lindner
Date: Fri Dec 5 02:54:27 2008
New Revision: 723705
URL: http://svn.apache.org/viewvc?rev=723705&view=rev
Log:
Performance Patch from hi5
- errorMessage was being created for every getter json serialization
- on a heavily loaded server GC overhead went from 10% to 2%
Where is the JIRA for it?
What exactly made the GC overhead go down? Declaring the parameters
final or moving the error string generation around?
The error string was generated for every single field when serializing
an object. So if you have the person object with say 10 fields you
generate 10 error message strings. That's a lot of Strings!
The final modifiers were added as a matter of course. If that makes
it hard for people to subclass then we can put them back. Modern JVMs
are pretty smart about final vs. non-final these days.
FWIW we ran the old code vs the new code with the YourKit profiler
with about 5k r/s, most of them rpc requests. The difference was huge.
Wouldn't it make it much more sense to move the string generation into
the catch blocks and keep the additional method out?
Well, then we'd have to duplicate code inside of each catch block.
I'm pretty happy with the implementation as it stands.
Paul Lindner
[EMAIL PROTECTED]