java三种实例对象方式性能比拼
2010-07-20 16:05
302 查看
测试单位:毫微秒
测试次数:5
第一种:普通的new对象
第二种:用获取到的Class对象调用newInstance()方法
第三种:用获取到类中的Constructor对象调用newInstance()方法
new
cost time:15029843
cost time:9462656
cost time:9229386
cost time:9313753
cost time:9725817
Class.newInstance
cost time:1114809564
cost time:1083132353
cost time:1078971210
cost time:1097584191
cost time:1088212608
Constructor.newInstance
cost time:1021233983
cost time:995615364
cost time:992249853
cost time:1005193956
cost time:1015676294
测试次数:5
第一种:普通的new对象
第二种:用获取到的Class对象调用newInstance()方法
第三种:用获取到类中的Constructor对象调用newInstance()方法
new
cost time:15029843
cost time:9462656
cost time:9229386
cost time:9313753
cost time:9725817
Class.newInstance
cost time:1114809564
cost time:1083132353
cost time:1078971210
cost time:1097584191
cost time:1088212608
Constructor.newInstance
cost time:1021233983
cost time:995615364
cost time:992249853
cost time:1005193956
cost time:1015676294
相关文章推荐
- Java反射之类的实例对象的三种表示方式总结
- Java反射之类的实例对象的三种表示方式
- 基于Java的三种对象持久化方式
- java语言反射的概述以及三种获取字节码文件对应的Class类型的对象的方式
- Java基础之获取Class对象的三种方式
- Java创建对象实例的三种方法
- Java Class类以及获取Class实例的三种方式
- Java对象的复制三种方式
- Java反射获取类对象的三种方式
- java中三种方式获得类的字节码文件对象
- java 反射之获取class对象的三种方式
- Java中的Class类以及获取Class对象的三种方式
- Java创建对象实例的三种方法
- java 反射 获取Class对象的三种方式
- 改进Java中的对象管理方式,提高程序性能
- Java线程之锁对象Lock-同步问题更完美的处理方式代码实例
- JAVA反射(一)获取Class对象的三种方式及其区别
- Java实现克隆的三种方式实例总结
- Java Class类以及获取Class实例的三种方式
- 并发编程学习总结(一) :java 创建线程的三种方式的优缺点和实例