Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>

@arey arey Jun 9, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion do not commit this file
I've just ignore it in the .gitignore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry~

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.javaetmoi.benchmark</groupId>
<artifactId>java-object-mapper-benchmark</artifactId>
<name>JMH benchmark of Object-to-Object mapping frameworks/</name>
<version>1.0.0-SNAPSHOT</version>
<prerequisites>
<maven>3.9</maven>
</prerequisites>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.2</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<argLine>--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens java.desktop/java.awt.font=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${uberjar.name}</finalName>
<transformers>
<transformer>
<mainClass>org.openjdk.jmh.Main</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.37</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>fr.xebia.extras</groupId>
<artifactId>selma-processor</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>6.1.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>junit-platform-engine</artifactId>
<groupId>org.junit.platform</groupId>
</exclusion>
<exclusion>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
<exclusion>
<artifactId>jspecify</artifactId>
<groupId>org.jspecify</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<version.dozer>7.0.0</version.dozer>
<version.bull>3.0.4</version.bull>
<version.modelmapper>3.2.6</version.modelmapper>
<version.remap>4.3.7</version.remap>
<uberjar.name>benchmarks</uberjar.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.orika>1.6.0</version.orika>
<version.junit>6.1.0</version.junit>
<java.version>17</java.version>
<jakarta.el-api.version>4.0.0</jakarta.el-api.version>
<version.selma>1.0</version.selma>
<version.jmh>1.37</version.jmh>
<version.mapstruct>1.6.3</version.mapstruct>
<version.slf4j>2.0.9</version.slf4j>
<version.jmapper>1.6.1.CR2</version.jmapper>
<version.sjf4j>1.3.1</version.sjf4j>
<version.datus>1.5.0</version.datus>
</properties>
</project>
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<version.bull>3.0.4</version.bull>
<version.datus>1.5.0</version.datus>
<version.remap>4.3.7</version.remap>
<version.sjf4j>1.3.1</version.sjf4j>
<version.junit>6.1.0</version.junit>
<version.slf4j>2.0.9</version.slf4j>
<jakarta.el-api.version>4.0.0</jakarta.el-api.version> <!-- Required by Dozer -->
Expand Down Expand Up @@ -117,6 +118,17 @@
<version>${version.remap}</version>
</dependency>

<dependency>
<groupId>org.sjf4j</groupId>
<artifactId>sjf4j</artifactId>
<version>${version.sjf4j}</version>
</dependency>
<dependency>
<groupId>org.sjf4j</groupId>
<artifactId>sjf4j-processor</artifactId>
<version>${version.sjf4j}</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/javaetmoi/benchmark/MapperBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.javaetmoi.benchmark.mapping.mapper.orika.OrikaMapper;
import com.javaetmoi.benchmark.mapping.mapper.remappe.ReMappeMapper;
import com.javaetmoi.benchmark.mapping.mapper.selma.SelmaMapper;
import com.javaetmoi.benchmark.mapping.mapper.sjf4j.Sjf4jMapper;
import com.javaetmoi.benchmark.mapping.model.dto.OrderDTO;
import com.javaetmoi.benchmark.mapping.model.entity.Order;
import com.javaetmoi.benchmark.mapping.model.entity.OrderFactory;
Expand All @@ -27,7 +28,7 @@
@State(Scope.Benchmark)
public class MapperBenchmark {

@Param({"Manual", "MapStruct", "Selma", "JMapper", "datus", "Orika", "ModelMapper", "BULL", "Dozer", "ReMap"})
@Param({"Manual", "MapStruct", "Selma", "JMapper", "datus", "Orika", "ModelMapper", "BULL", "Dozer", "ReMap", "SJF4J"})
private String type;

private OrderMapper mapper;
Expand Down Expand Up @@ -66,6 +67,9 @@ public void setup() {
case "ReMap":
mapper = new ReMappeMapper();
break;
case "SJF4J":
mapper = new Sjf4jMapper();
break;
default:
throw new IllegalStateException("Unknown type: " + type);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.javaetmoi.benchmark.mapping.mapper.sjf4j;

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.sjf4j.compiled.CompiledNodes;


public class Sjf4jMapper implements OrderMapper {

private final Sjf4jOrderMapper mapper = CompiledNodes.of(Sjf4jOrderMapper.class);

@Override
public OrderDTO map(Order source) {
return mapper.map(source);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.javaetmoi.benchmark.mapping.mapper.sjf4j;

import com.javaetmoi.benchmark.mapping.mapper.OrderMapper;
import com.javaetmoi.benchmark.mapping.model.dto.OrderDTO;
import com.javaetmoi.benchmark.mapping.model.dto.ProductDTO;
import com.javaetmoi.benchmark.mapping.model.entity.Order;
import com.javaetmoi.benchmark.mapping.model.entity.Product;
import org.sjf4j.annotation.mapper.CompiledMapper;
import org.sjf4j.annotation.mapper.Mapping;
import org.sjf4j.annotation.mapper.Mappings;

@CompiledMapper
public interface Sjf4jOrderMapper extends OrderMapper {

@Mappings({
@Mapping(target = "customerName", source = "$.customer.name"),
@Mapping(target = "billingStreetAddress", source = "$.customer.billingAddress.street"),
@Mapping(target = "billingCity", source = "$.customer.billingAddress.city"),
@Mapping(target = "shippingStreetAddress", source = "$.customer.shippingAddress.street"),
@Mapping(target = "shippingCity", source = "$.customer.shippingAddress.city"),
})
OrderDTO map(Order source);

ProductDTO productToProductDTO(Product product);

}
Loading