分类
运行期
DozerBeanMapper,ModelMaper,BeanUtils,BeanCopier,PropertyUtils
编译期
MapStruct,Selma,Orika
| 类 | 方法 | 归属 | 单次耗时[ms] | 100万次耗时[ms] | 平均耗时[ms] |
|---|---|---|---|---|---|
| BeanUtils | copyProperties | Apache | 0.088523 | 32556.660915 | 0.032556 |
| DozerBeanMapper | map | Dozer | 0.112480 | 17818.511072 | 0.017818 |
| PropertyUtils | copyProperties | Apache | 0.055119 | 18046.194031 | 0.018046 |
| BeanUtils | copyProperties | Spring | 0.025337 | 1969.376513 | 0.001969 |
| BeanCopier | copy | Cglib | 0.001124 | 69.608191 | 0.000069 |
推荐
MapStruct 、BeanCopier
参考
各类对象属性拷贝工具性能测试对比(BeanCopier、BeanUtils、DozerBeanMapper、PropertyUtils)
MapStruct 代替BeanUtil 和ModelMapper
[https://blog.csdn.net/qq496013218/article/details/74290772?locationNum=8&fps=1](https://blog.csdn.net/qq496013218/article/details/74290772?locationNum=8&fps=1)