{"id":15628554,"url":"https://github.com/arey/java-object-mapper-benchmark","last_synced_at":"2025-04-05T16:10:11.260Z","repository":{"id":5738026,"uuid":"42470107","full_name":"arey/java-object-mapper-benchmark","owner":"arey","description":"JMH benchmark of Java object-to-object mapping frameworks","archived":false,"fork":false,"pushed_at":"2024-09-04T06:12:01.000Z","size":440,"stargazers_count":286,"open_issues_count":3,"forks_count":53,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-29T15:06:07.696Z","etag":null,"topics":["benchmark","bull","datus","dozer","jmapper","jmh","mapstruct","modelmapper","orika","selma"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arey.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-14T18:54:47.000Z","updated_at":"2025-03-22T08:32:42.000Z","dependencies_parsed_at":"2024-10-23T00:37:26.589Z","dependency_job_id":null,"html_url":"https://github.com/arey/java-object-mapper-benchmark","commit_stats":{"total_commits":63,"total_committers":12,"mean_commits":5.25,"dds":0.7301587301587302,"last_synced_commit":"da82bba826495b54ad72393d1b450c71512cff4c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arey%2Fjava-object-mapper-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arey%2Fjava-object-mapper-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arey%2Fjava-object-mapper-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arey%2Fjava-object-mapper-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arey","download_url":"https://codeload.github.com/arey/java-object-mapper-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361695,"owners_count":20926643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","bull","datus","dozer","jmapper","jmh","mapstruct","modelmapper","orika","selma"],"created_at":"2024-10-03T10:23:04.011Z","updated_at":"2025-04-05T16:10:11.239Z","avatar_url":"https://github.com/arey.png","language":"Java","readme":"# Object-to-object mapping framework microbenchmark\n![CI](https://github.com/arey/java-object-mapper-benchmark/workflows/CI/badge.svg)\n\nMulti-layered applications often require to map between different object models (e.g. DTOs and entities). \nWriting such boiler plate mapping code is a tedious and error-prone task.\nA lot of object-to-object mapping Java frameworks aims to simplify this work and automate it.\nSome uses code instrospection (eg. Dozer). Other uses code generation (ex: MapStruct).\nThis micro-benchmark compares performance of 9 frameworks. Results could be compared to the benchmark of a code written manually. \n\nBenchmark are powered by a tool called [JMH](http://openjdk.java.net/projects/code-tools/jmh/) or also known as \"Java Microbenchmarking Harness\".\nJMH is developed by the OpenJDK team. \n\n## Benchmarked object to object mapper frameworks\n\n- [Dozer](https://github.com/DozerMapper/dozer)\n- [MapStruct](http://mapstruct.org/)\n- [ModelMapper](http://modelmapper.org/)\n- [Selma](http://www.selma-java.org/)\n- [Orika](https://github.com/orika-mapper/orika)\n- [JMapper](https://github.com/jmapper-framework/jmapper-core)\n- [BULL](https://github.com/HotelsDotCom/bull)\n- [datus](https://github.com/roookeee/datus)\n- [ReMap](https://github.com/remondis-it/remap)\n\n## Contributing to benchmark\n\n\nGithub is for social coding platform: if you want to add another mapping framework or optimize an existing one, we encourage contributions \nthrough pull requests from [forks of this repository](http://help.github.com/forking/).\nIf you want to contribute code this way, please reference a GitHub ticket as well covering the specific issue you are addressing.\nTo add a new mapper, please add a unit test that extends the `AbstractMapperTest` class and declare your mapper into the `MapperBenchmark` class. \n\n\n## Data model\n\nThe data model used by this benchmark is very basic. It comes from the [Comparison](https://github.com/jhalterman/modelmapper/blob/master/core/src/test/java/org/modelmapper/performance/Comparison.java) class from the ModelMapper framework.\nIt includes combinations which usually appear in Java Beans, such as:\n\n* Object types\n* Collections\n\n![Data model UML diagram](/model.png)\n\n## Launch the benchmark\n\n_Pre-requisites: Maven 3.x and a JDK 8 (or above)_\n\n``git clone git://github.com/arey/java-object-mapper-benchmark.git``\n\n``mvn clean install``\n\n``java -jar target/benchmarks.jar``\n\nOptional: To run a single benchmark, such as MapStruct, use `java -jar target/benchmarks.jar -p type=MapStruct`\n\n## Interpreting the Results\n\nThe benchmarks measure throughput, given in \"ops/time\". The time unit used is seconds.\nGenerally, the score represents the number of graph object mapped per second; the higher the score, the better.\n\n## Results\n\nTests has been performed on:\n\n* OS: macOS High Sierra\n* CPU: 3.1 GHz Intel Core i7, 2 cores, L2 Cache (per Core): 256 KB,  L3 Cache: 4 MB\n* RAM: 16 GB 1867 MHz DDR3\n* JVM: Oracle 1.8.0_74-b02 64 bits\n\n| Benchmark      | Mode  | Samples | Score       | Margin error (+/-) | Units |\n|----------------|-------|---------|-------------|--------------------|-------|\n| Manual         | thrpt | 200     | 26 978 437  | 615 002            | ops/s |\n| MapStruct      | thrpt | 200     | 28 039 597  | 199 255            | ops/s |\n| Selma          | thrpt | 200     | 27 518 789  | 238 602            | ops/s |\n| JMapper        | thrpt | 200     | 24 531 754  | 123 945            | ops/s |\n| Orika          | thrpt | 200     |  4 565 378  |  24 947            | ops/s |\n| ModelMapper    | thrpt | 200     |    184 304  |  12 777            | ops/s |\n| Dozer          | thrpt | 200     |     89 860  |     462            | ops/s |\n| BULL           | thrpt | 200     |    178 027  |     679            | ops/s |\n| datus          | thrpt | 200     |  8 230 775  |  59 673            | ops/s |\n\n\n![Framework Comparison](results.png)\n\n\n## Documentation\n\n* [Micro-benchmark of Java mapping object frameworks](http://javaetmoi.com/2015/09/benchmark-frameworks-java-mapping-objet/) (french article)\n\n## Generating plot\n\n1. Run benchmark while exporting results to csv with `java -jar target/benchmarks.jar -rff results.csv -rf csv`\n2. Use gnuplot to generate plot with `gnuplot benchmark.plt`. This will output `results.png`.\n\n## Credits\n\n* Uses [Maven](http://maven.apache.org/) as a build tool\n* Uses [JMH](http://openjdk.java.net/projects/code-tools/jmh/) for Java Microbenchmarking Harness\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farey%2Fjava-object-mapper-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farey%2Fjava-object-mapper-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farey%2Fjava-object-mapper-benchmark/lists"}