diff --git a/pom.xml b/pom.xml index 2a370f3..71292ed 100644 --- a/pom.xml +++ b/pom.xml @@ -14,10 +14,10 @@ - 1.5.2 - 6.1.0 - 1.1.0 - 1.2.0.Final + 1.5.4 + 6.5.0 + 2.3.5 + 1.3.0.Final 1.0 1.6.1.CR2 1.19 diff --git a/readme.md b/readme.md index fa1ab92..6ec71d8 100644 --- a/readme.md +++ b/readme.md @@ -65,35 +65,18 @@ Tests has been performed on: * RAM: 16 GB 1867 MHz DDR3 * JVM: Oracle 1.8.0_74-b02 64 bits - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BenchmarkModeSamplesScoreMargin error (+/-)Units
Manualthrpt20027 598 750346 265ops/s
MapStructthrpt20027 206 021133 009ops/s
Selmathrpt20026 205 612185 326ops/s
JMapperthrpt20023 377 962124 537ops/s
Orikathrpt2004 097 03021 220ops/s
BULLthrpt200468 1294955ops/s
ModelMaperthrpt200323 7913 172ops/s
Dozerthrpt20084 113331ops/s
+| Benchmark | Mode | Samples | Score | Margin error (+/-) | Units | +|----------------|-------|---------|-------------|--------------------|-------| +| Manual | thrpt | 200 | 26 978 437 | 615 002 | ops/s | +| MapStruct | thrpt | 200 | 28 039 597 | 199 255 | ops/s | +| Selma | thrpt | 200 | 27 518 789 | 238 602 | ops/s | +| JMapper | thrpt | 200 | 24 531 754 | 123 945 | ops/s | +| Orika | thrpt | 200 | 4 565 378 | 24 947 | ops/s | +| ModelMapper | thrpt | 200 | 184 304 | 12 777 | ops/s | +| Dozer | thrpt | 200 | 89 860 | 462 | ops/s | +| BULL | thrpt | 200 | 121 967 | 973 | ops/s | +| datus | thrpt | 200 | 8 230 775 | 59 673 | ops/s | + ![Framework Comparison](results.png) diff --git a/results.csv b/results.csv index e16dba1..25e7969 100644 --- a/results.csv +++ b/results.csv @@ -1,9 +1,12 @@ "Benchmark","Mode","Threads","Samples","Score","Score Error (99,9%)","Unit","Param: type" -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"27598750,161992","346265,704225","ops/s",Manual -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"27206021,062526","133009,298251","ops/s",MapStruct -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"26205612,876587","185326,677688","ops/s",Selma -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"23377962,917915","124537,993554","ops/s",JMapper -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"4097030,344104","21220,567480","ops/s",Orika -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"468129.769383","4955.739447","ops/s",BULL -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"323791,972104","3172,754252","ops/s",ModelMapper -"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"84113,220613","331,664883","ops/s",Dozer +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"26978437,866517","615002,224893","ops/s",Manual +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"28039597,815878","199255,230955","ops/s",MapStruct +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"27518789,645248","238602,253918","ops/s",Selma +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"24531754,377299","123945,801129","ops/s",JMapper +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"8230775,891415","59673,825530","ops/s",datus +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"4565378,535779","24947,644996","ops/s",Orika +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"184304,271986","1277,567799","ops/s",ModelMapper +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"121967,799622","973,434200","ops/s",BULL +"com.javaetmoi.benchmark.MapperBenchmark.mapper","thrpt",1,200,"89860,325285","462,290433","ops/s",Dozer + + diff --git a/results.png b/results.png index 79e8b2a..4edb334 100644 Binary files a/results.png and b/results.png differ diff --git a/src/main/java/com/javaetmoi/benchmark/MapperBenchmark.java b/src/main/java/com/javaetmoi/benchmark/MapperBenchmark.java index ba59807..79fad55 100644 --- a/src/main/java/com/javaetmoi/benchmark/MapperBenchmark.java +++ b/src/main/java/com/javaetmoi/benchmark/MapperBenchmark.java @@ -29,7 +29,7 @@ @State(Scope.Benchmark) public class MapperBenchmark { - @Param({"Manual", "MapStruct", "Selma", "JMapper", "Orika", "ModelMapper", "Dozer", "BULL", "datus"}) + @Param({"Manual", "MapStruct", "Selma", "JMapper", "datus", "Orika", "ModelMapper", "BULL", "Dozer"}) private String type; private OrderMapper mapper; diff --git a/src/main/java/com/javaetmoi/benchmark/mapping/mapper/dozer/DozerMapper.java b/src/main/java/com/javaetmoi/benchmark/mapping/mapper/dozer/DozerMapper.java index 81121de..abd5f5f 100644 --- a/src/main/java/com/javaetmoi/benchmark/mapping/mapper/dozer/DozerMapper.java +++ b/src/main/java/com/javaetmoi/benchmark/mapping/mapper/dozer/DozerMapper.java @@ -1,18 +1,22 @@ package com.javaetmoi.benchmark.mapping.mapper.dozer; +import com.github.dozermapper.core.DozerBeanMapperBuilder; +import com.github.dozermapper.core.Mapper; import com.javaetmoi.benchmark.mapping.mapper.OrderMapper; import com.javaetmoi.benchmark.mapping.model.dto.OrderDTO; import com.javaetmoi.benchmark.mapping.model.entity.Order; -import org.dozer.DozerBeanMapper; -import java.util.Arrays; +import java.util.Collections; public class DozerMapper implements OrderMapper { - private DozerBeanMapper beanMapper = new DozerBeanMapper(); + private Mapper beanMapper; public DozerMapper() { - beanMapper.setMappingFiles(Arrays.asList("com/javaetmoi/benchmark/mapping/mapper/dozer/dozer.xml")); + beanMapper = DozerBeanMapperBuilder + .create() + .withMappingFiles(Collections.singletonList("com/javaetmoi/benchmark/mapping/mapper/dozer/dozer.xml")) + .build(); } @Override