| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This project benchmarks the throughput performance of a variety of Java Json libraries using JMH. It covers the following libraries:
When available, both databinding and 'stream' (custom packing and unpacking) implementations are tested. Two different kinds of models are evaluated with payloads of 1, 10, 100 and 1000 KB size:
This benchmark is written to:
Not evaluated are: RAM utilization, compression, payloads > 1 MB.
The benchmarks are written with JMH and for Java 25.
The results here-below were computed on February the 28th, 2026 with the following libraries and versions:
| Library | Version |
|---|---|
| avaje-jsonb | 1.11 |
| boon | 0.34 |
| djomo | 0.9.4 |
| dsl-json | 2.0.2 |
| fastjson | 2.0.57 |
| flexjson | 3.3 |
| genson | 1.6 |
| gson | 2.11.1 |
| jackson | 2.17.1 |
| jodd json | 6.0.3 |
| johnzon | 2.0.1 |
| jakarta | 2.1.3 |
| json-io | 4.88.0 |
| simplejson | 1.1.1 |
| json-smart | 2.5.1 |
| logansquare | 1.3.7 |
| minimal-json | 0.9.5 |
| mjson | 1.4.1 |
| moshi | 1.15.1 |
| nanojson | 1.9 |
| org.json | 20240303 |
| purejson | 1.0.1 |
| qson | 1.1.1 |
| tapestry | 5.8.6 |
| underscore | 1.101 |
| yasson | 3.0.3 |
| wast | 0.0.29.1 |
All graphs and sheets are available in this google doc.
Raw JMH results are available here
Uses: primitive types, String, List and simple POJOs
Uses: primitive types, String, List and simple POJOs, arrays, enum, UUID, LocalDate
Note: fewer libraries are tested with this model due to lack of support for some of the evaluated types.
Tests were run on an Amazon EC2 c8g.xlarge (4 vCPU, 8 GiB RAM)
JMH info:
# JMH version: 1.35 # VM version: JDK 25.0.2, OpenJDK 64-Bit Server VM, 25.0.2+10-LTS # VM invoker: /usr/lib/jvm/java-25-amazon-corretto.aarch64/bin/java # VM options: -Xms2g -Xmx2g --add-opens=java.base/java.time=ALL-UNNAMED --add-modules=jdk.incubator.vector # Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false to disable) # Warmup: 5 iterations, 10 s each # Measurement: 10 iterations, 3 s each # Timeout: 10 min per iteration # Threads: 3 threads, will synchronize iterations # Benchmark mode: Throughput, ops/time
Prerequisites:
By default, running ./run ser (./run deser respectively) will run all -- stream and databind -- serialization (deserialization respectively) benchmarks with 1 KB payloads of Users.
You can also specify which libs, apis, payload-sizes and number of iterations (and more) you want to run. For example:
./run deser --apis stream --libs genson,jackson ./run ser --apis databind,stream --libs jackson ./run deser --apis stream --libs dsljson,jackson --size 10 --datatype users
Type ./run help ser or ./run help deser to print help for those commands.
If you wish to run all benchmarks used to generate the reports above, you can run ./run-everything. This will take several hours to complete, so be patient.
You can use Docker if you wish to reproduce the consistent environment or to run benchmarks in a separate safe environment.
Prerequisites:
Build and run:
docker build -t java-json-benchmark:latest . docker run --rm -it java-json-benchmark:latest ./run deser
Prerequisites:
Then, simply run:
make packer
Any help to improve the existing benchmarks or write ones for other libraries is welcome.
Adding a JSON library to the benchmark requires little work and you can find numerous examples in the commit history. For instance:
Pull requests are welcome.
| Back | FazBrowse Home | New Git URL |