views:

585

answers:

2

Many modern frameworks (Spring, Hibernate) provide very nice dynamic behaviors with use of Java dynamic proxies, but what's the exact performance cost associated with it? Are there public benchmarks available for Sun JVM?

+6  A: 

A few pointers:

Pascal Thivent
Thanks for the links, especially for the last one that provides the real benchmark number: factor of 1.63 in raw use
Gennady Shumakher
+4  A: 

I don't know if there is any performance analysis in the framework you mentioned, but in my project lambdaj I made a very large use of dynamic proxy using the same technology (cglib). In the pdf that explains how my library works you can also find an interesting performance comparison on this subject.

Mario Fusco
If I got it right your framework slows the iterations by average factor of 4.56, but would you relate it to the cglib proxies or to other elements of the library?
Gennady Shumakher
The 2 things that mostly slow down the performance of lambdaj are cglib and reflection. My measurements shows that the second is just a bit more relevant than the first. So I suppose that roughly an invocation through cglib can be considered about twice slower than a normal one.
Mario Fusco