Hello,
Long time listener, first time caller here - thanks for an excellent
framework.
We've been profiling our Hibernate 3.6.10-based app and noticed a perf
bottleneck in javassist.util.proxy.RuntimeSupport.find2methods.
Unfortunately, this method, which has a synch. block, is being called on
every invocation of every proxied entity method (see
javassist.util.proxy.ProxyFactory.makeForwarder(), called indirectly by
ProxyFactory.createClass()). In our testing, the result is that our service
call's latency increases from 33 to 55, 260, 400ms as concurrency increases
1-10-20-30 users on a 4-core CPU. At 20 and 30 users 51% of CPU time is
spent contending for a monitor in RuntimeSupport.find2methods.
Since find2methods merely interrogates class metadata, seems like its return
values should be cached (in a ConcurrentMap?). Since this is a big problem
for us, I am happy to submit a patch to javassist, but would like to know
which version should I be patching, given that I am primarily interesting in
using javassist in conjunction with Hibernate? Currently, hibernate-core
4.1.1 uses javassist 3.15.0-GA, 3.10.Final uses 3.12. Latest GA is 3.16-1.
I'd appreciate any other advice as well (perhaps this problem's been
discussed?)
Thank you,
-nikita