GitPedia

Java object mapper benchmark

JMH benchmark of Java object-to-object mapping frameworks

From arey·Updated June 21, 2026·View on GitHub·

Multi-layered applications often require to map between different object models (e.g. DTOs and entities). Writing such boiler plate mapping code is a tedious and error-prone task. A lot of object-to-object mapping Java frameworks aims to simplify this work and automate it. Some uses code instrospection (eg. Dozer). Other uses code generation (ex: MapStruct). This micro-benchmark compares performance of 9 frameworks. Results could be compared to the benchmark of a code written manually. The project is written primarily in Java, first published in 2015. Key topics include: benchmark, bull, datus, dozer, jmapper.

Object-to-object mapping framework microbenchmark

CI

Multi-layered applications often require to map between different object models (e.g. DTOs and entities).
Writing such boiler plate mapping code is a tedious and error-prone task.
A lot of object-to-object mapping Java frameworks aims to simplify this work and automate it.
Some uses code instrospection (eg. Dozer). Other uses code generation (ex: MapStruct).
This micro-benchmark compares performance of 9 frameworks. Results could be compared to the benchmark of a code written manually.

Benchmark are powered by a tool called JMH or also known as "Java Microbenchmarking Harness".
JMH is developed by the OpenJDK team.

Benchmarked object to object mapper frameworks

Contributing to benchmark

Github is for social coding platform: if you want to add another mapping framework or optimize an existing one, we
encourage contributions
through pull requests from forks of this repository.
If you want to contribute code this way, please reference a GitHub ticket as well covering the specific issue you are
addressing.
To add a new mapper, please add a unit test that extends the AbstractMapperTest class and declare your mapper into the
MapperBenchmark class.

Data model

The data model used by this benchmark is very basic. It comes from the Comparison class from the ModelMapper framework.
It includes combinations which usually appear in Java Beans, such as:

  • Object types
  • Collections

Data model UML diagram

Launch the benchmark

Pre-requisites: Maven 3.x and a JDK 17 (or above)

git clone git://github.com/arey/java-object-mapper-benchmark.git

mvn clean install

java @jvm.options -jar target/benchmarks.jar

Optional: To run a single benchmark, such as MapStruct, use
java @jvm.options -jar target/benchmarks.jar -p type=MapStruct

Interpreting the Results

The benchmarks measure throughput, given in "ops/time". The time unit used is seconds.
Generally, the score represents the number of graph object mapped per second; the higher the score, the better.

Results

Tests has been performed on:

  • OS: macOS Tahoe 26.5
  • CPU: Apple M4 Pro
  • RAM: 24 GB
  • JVM: Eclipse Temurin 21.0.5+11
BenchmarkModeSamplesScoreScore Error (99,9%)Units
Manualthrpt20098 433 829560 874ops/s
SJF4Jthrpt20096 845 4841 137 711ops/s
MapStructthrpt20094 501 3141 153 765ops/s
Selmathrpt20092 624 5941 032 208ops/s
JMapperthrpt20083 623 847404 936ops/s
datusthrpt20033 690 856863 388ops/s
Orikathrpt20015 488 089385 665ops/s
ReMapthrpt2002 020 680127 259ops/s
ModelMapperthrpt200451 5487 450ops/s
BULLthrpt200387 8956 636ops/s
Dozerthrpt200333 33410 383ops/s

Framework Comparison

Documentation

Generating plot

  1. Run benchmark while exporting results to csv with java @jvm.options -jar target/benchmarks.jar -rff results.csv -rf csv
  2. Use gnuplot to generate plot with gnuplot benchmark.plt. This will output results.png.

Credits

  • Uses Maven as a build tool
  • Uses JMH for Java Microbenchmarking Harness

Contributors

Showing top 9 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from arey/java-object-mapper-benchmark via the GitHub API.Last fetched: 6/23/2026