简体   繁体   中英

MapStruct Vs Normal Java Code - Which is more performing?

I have a source POJO and a target POJO, with 10 fields having getters and setters.

  1. If I use MapStruct to map source POJO to target POJO, a precompiled class file will be created by MapStruct which will then be compiled by JVM.

  2. Write normal manual java code to map source to target by accessing getter and setter methods.

Will there be any improvement in performance regarding latency of JVM if we use MapStruct over normal manual mapping code? Or, in this case, are we using MapStruct just for saving developer's time to write manual mapping code?

There are some benchmarks at https://www.baeldung.com/java-performance-mapping-frameworks

In my opinion, there is no difference in performance

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM