Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not be performed. Consequently, reflective operations have slower performance than their non-reflective counterparts, and should be avoided in sections of code which are called frequently in performance-sensitive applications.
反射是动态的对类型、方法进行解析,肯定是会比直接调用慢一点。jvm无法优化
java反射机制,是在运行状态中,对于任何一个类,都能够访问这个类的所有属性和方法,同时任何一个对象也都能够调用它的任意一个方法和属性,这个功能称为java语言的反射机制。
来源:oschina
链接:https://my.oschina.net/u/1383356/blog/550748