Search code examples
javabyte-buddy

What kind of overhead occurs in Bytebuddy's Advice operation?


With Bytebuddy's Advice, I want to know what the overhead difference is compared to MethodDelegation.


Solution

  • There's no real performance difference. By default, advice inlines its code while method delegation invokes a different method. This has more to do with code visibility then with performance what the JIT normally figures out just fine.