The techniques used in dynamic programming in Java are: Reflection (Dynamic proxy), javassist and ASM, these dynamic programming methods, compared to javassist above reflection in performance, but less than ASM, because Javassist adds a layer of abstraction. Javassist and reflection are low at the cost of implementation, and ASM is much more expensive than the Javassist source-level API because of the direct manipulation of bytecode. Several methods have their own application scenarios, such as Kryo using ASM, the pursuit of maximum performance. The nbeancopyutil uses javassist, which has significantly higher performance on object copies than other libraries and maintains high ease of use. The actual project is recommended to use Javassist to achieve the prototype, if the performance test found that javassist become a performance bottleneck, and then consider using other bytecode operation method to optimize.
Java Dynamic Programming