Skip to content

Commit

Permalink
Update all mappers to their most recent version and update the readme #…
Browse files Browse the repository at this point in the history
  • Loading branch information
arey committed Sep 8, 2019
1 parent 596aafa commit d2056a1
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 46 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</prerequisites>

<properties>
<version.orika>1.5.2</version.orika>
<version.dozer>6.1.0</version.dozer>
<version.modelmapper>1.1.0</version.modelmapper>
<version.mapstruct>1.2.0.Final</version.mapstruct>
<version.orika>1.5.4</version.orika>
<version.dozer>6.5.0</version.dozer>
<version.modelmapper>2.3.5</version.modelmapper>
<version.mapstruct>1.3.0.Final</version.mapstruct>
<version.selma>1.0</version.selma>
<version.jmapper>1.6.1.CR2</version.jmapper>
<version.jmh>1.19</version.jmh>
Expand Down
41 changes: 12 additions & 29 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,18 @@ Tests has been performed on:
* RAM: 16 GB 1867 MHz DDR3
* JVM: Oracle 1.8.0_74-b02 64 bits

<table>
<tr>
<th>Benchmark</th><th>Mode</th><th>Samples</th><th>Score</th><th>Margin error (+/-)</th><th>Units</th>
</tr>
<tr>
<th>Manual</th><td>thrpt</td><td>200</td><td>27 598 750</td><td>346 265</td><td>ops/s</td>
</tr>
<tr>
<th>MapStruct</th><td>thrpt</td><td>200</td><td>27 206 021</td><td>133 009</td><td>ops/s</td>
</tr>
<tr>
<th>Selma</th><td>thrpt</td><td>200</td><td>26 205 612</td><td>185 326</td><td>ops/s</td>
</tr>
<tr>
<th>JMapper</th><td>thrpt</td><td>200</td><td>23 377 962</td><td>124 537</td><td>ops/s</td>
</tr>
<tr>
<th>Orika</th><td>thrpt</td><td>200</td><td>4 097 030</td><td>21 220</td><td>ops/s</td>
</tr>
<tr>
<th>BULL</th><td>thrpt</td><td>200</td><td>468 129</td><td>4955</td><td>ops/s</td>
</tr>
<tr>
<th>ModelMaper</th><td>thrpt</td><td>200</td><td>323 791</td><td>3 172</td><td>ops/s</td>
</tr>
<tr>
<th>Dozer</th><td>thrpt</td><td>200</td><td>84 113</td><td>331</td><td>ops/s</td>
<tr>
</table>
| 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)

Expand Down
19 changes: 11 additions & 8 deletions results.csv
Original file line number Diff line number Diff line change
@@ -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


Binary file modified results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/java/com/javaetmoi/benchmark/MapperBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d2056a1

Please sign in to comment.