PropertyUtils、BeanUtils的copyProperties()和set、get性能比较
2010-10-27 17:44
288 查看
A a1 = new A(); a1.setName("wang"); A a2 = new A(); long b = new java.util.Date().getTime(); a2.setName(a1.getName()); long e = new java.util.Date().getTime(); System.out.println("time1="+(e-b)); A a3 = new A(); b = new java.util.Date().getTime(); PropertyUtils.copyProperties(a3, a1); e = new java.util.Date().getTime(); System.out.println("time2="+(e-b));
输出结果time1的时间比time2的时间小,用PropertyUtils、BeanUtils时间差不多。PropertyUtils支持不同类型相同变量名的拷贝,它会自动转换数据类型
相关文章推荐
- 【转】Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier性能比较
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- Bean复制的几种框架性能比较(Apache BeanUtils、PropertyUtils,Spring BeanUtils,Cglib BeanCopier)
- windows平台时间函数性能比较QueryPerformanceCounter,GetTickCount,ftime,time,GetLocalTime,GetSystemTimeAsFileTim
- java中的get和set方法(比较详细)
- sql查询性能调试,用SET STATISTICS IO和SET STATISTICS TIME---解释比较详细
- 【ThinkingInJava】55、对set中的操作测试性能比较
- php中file_get_contents()与curl()性能比较
- 使用BeanUtils.populate方法转化Map为Javabean时get与set方法的命名规则
- 有关BeanUtils的copyProperties与有关PropertyUtils的copyProperties
- php file_get_contents与curl性能比较
- 比较测试map、unodered_map、unordered_set性能效率,整型数值查找