Byte Buddy
: bytecode gen made easy ! @NicolasComet
https://github.com/ncomet
"Making Java more dynamic" @Devoxx France 2015
java.lang.reflect
Reading Type metamodel at runtime
Calling constructors, methods, access attributes (sometimes unsafely)
Mostly about Introspection
It has a cost (JIT is useless)
Calling fibonacci(42)
(average results)
Version | Time |
---|---|
Raw Fibonacci |
|
AspectJ (compile time) |
|
Byte Buddy (runtime) |
|
Spring AOP |
|
AspectJ
ajc
)Spring AOP
proxy-based
AspectJ
Spring AOP
Byte Buddy
Open Source (license Apache), used by Mockito
, Hibernate
, Google Bazle
, and others
Slides :
Sources :
Adding behavior
Discovering at runtime
/