Performance cost of Java dynamic proxy

前端 未结 3 1612
一个人的身影
一个人的身影 2021-01-30 06:52

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 t

相关标签:
3条回答
  • 2021-01-30 07:29

    A few pointers:

    • Debunking myths: proxies impact performance (have a look at the comments too)
    • Java theory and practice: Decorating with dynamic proxies
    • Benchmarking the cost of dynamic proxies
    0 讨论(0)
  • 2021-01-30 07:37

    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

    0 讨论(0)
  • 2021-01-30 07:44

    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.

    0 讨论(0)
提交回复
热议问题