search

Home  >  Q&A  >  body text

java - 为什么说编译时注解比反射效率高?

巴扎黑巴扎黑2910 days ago547

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-18 10:43:12

    Annotations can not only be obtained through reflection, but also bytecode can be generated at compile time through annotations, which is more efficient than reflection.
    The usual way to optimize reflection is to generate bytecode dynamically, such as cglib,静态生成比如Javassist.

    reply
    0
  • Cancelreply