Performance cost of Java dynamic proxy

2019-03-08 01:57发布

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?

3条回答
【Aperson】
3楼-- · 2019-03-08 02:24

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.

查看更多
别忘想泡老子
4楼-- · 2019-03-08 02:35

According to Remi Forax, java proxy forbid the Jit compiler to do correctly his job (inlining in this case).

See his rewrote of Proxy

https://github.com/forax/proxy2

查看更多
登录 后发表回答