fabienrenaud / java-json-benchmark

Performance testing of serialization and deserialization of Java JSON libraries
MIT License
973 stars 134 forks source link

Add avaje-jsonb version 0.11 #44

Closed rbygrave closed 2 years ago

rbygrave commented 2 years ago

avaje-jsonb

This is avaje-jsonb using it's own internal undering parser/generator (deemed the "default"). This "default" parser/generator is based on the code from dsl-json. In terms of performance this is not expected to be as fast as dsl-json but faster than Jackson.

avaje-jsonb_jackson

This is avaje-jsonb using jackson-core to do the underlying parser/generator. In terms of performance this should be in line with jackson with afterburner.

https://github.com/avaje/avaje-jsonb

rbygrave commented 2 years ago

I'd love to see if this could be merged :)

fabienrenaud commented 2 years ago

@rbygrave Please run the benchmark on your laptop in serialization and deserialization modes and with a few libs alongside yours (in your case, with jackson* and dsljson). When you have the results, please share them here.

rbygrave commented 2 years ago

Using JDK 17, removing VM arg -XX:+AggressiveOpts

./run -t 8 deser --apis databind --libs dsljson,jackson,avajejsonb

Benchmark                             Mode  Cnt        Score        Error  Units
Deserialization.avajejsonb           thrpt   20  1184936.808 ±  13918.489  ops/s
Deserialization.avajejsonb_jackson   thrpt   20   798975.188 ±  28215.452  ops/s
Deserialization.dsljson              thrpt   20  1519285.489 ± 125210.786  ops/s
Deserialization.dsljson_reflection   thrpt   20  1180949.236 ±   6277.985  ops/s
Deserialization.jackson              thrpt   20   835634.269 ±  34645.141  ops/s
Deserialization.jackson_afterburner  thrpt   20   839815.980 ±  41090.541  ops/s
./run -t 8 ser --apis databind --libs dsljson,jackson,avajejsonb

Benchmark                           Mode  Cnt        Score       Error  Units
Serialization.avajejsonb           thrpt   20  1555769.865 ± 38256.589  ops/s
Serialization.avajejsonb_jackson   thrpt   20  1248860.632 ± 44216.764  ops/s
Serialization.dsljson              thrpt   20  2107962.570 ± 81552.833  ops/s
Serialization.dsljson_reflection   thrpt   20  1421842.141 ± 75899.327  ops/s
Serialization.jackson              thrpt   20  1197192.645 ± 13753.249  ops/s
Serialization.jackson_afterburner  thrpt   20  1228355.192 ± 26704.995  ops/s

JMH 1.33, JDK 17+35-LTS-2724, Threads: 8, Warmup: 5 iterations, 10 s each, Measurement: 10 iterations, 3 s each

# JMH version: 1.33
# VM version: JDK 17, Java HotSpot(TM) 64-Bit Server VM, 17+35-LTS-2724
# VM invoker: /usr/lib/jvm/jdk-17/bin/java
# VM options: -Xms2g -Xmx2g
# Blackhole mode: full + dont-inline hint (default, use -Djmh.blackhole.autoDetect=true to auto-detect)
# Warmup: 5 iterations, 10 s each
# Measurement: 10 iterations, 3 s each
# Timeout: 10 min per iteration
# Threads: 8 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time
...
fabienrenaud commented 2 years ago

Thank you for your contribution @rbygrave