fabienrenaud / java-json-benchmark

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

Add the WAST library for testing #102

Closed wycst closed 4 months ago

wycst commented 5 months ago

Hello, this open-source performance testing project is fantastic. Can we add 'wast'( https://github.com/wycst/wast )Participate in performance testing, thank you very much!

fabienrenaud commented 4 months ago

Yes, on the condition that performance is higher than a few of the lowest performers in the benchmark. Please run ser+deser benchmarks for jackson,wast,gson.

wycst commented 4 months ago

Yes, on the condition that performance is higher than a few of the lowest performers in the benchmark. Please run ser+deser benchmarks for jackson,wast,gson.

The performance should be faster than most libraries, including the top few libraries, which I only tested on the window platform

fabienrenaud commented 4 months ago

I’m sure it’ll be fine. Please post the results of the benchmark here.

Fabien

On Wed, Apr 17, 2024 at 03:23 wycst @.***> wrote:

Yes, on the condition that performance is higher than a few of the lowest performers in the benchmark. Please run ser+deser benchmarks for jackson,wast,gson.

The performance should be faster than most libraries, including the top few libraries, which I only tested on the window platform

— Reply to this email directly, view it on GitHub https://github.com/fabienrenaud/java-json-benchmark/pull/102#issuecomment-2060929113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXX2KPSU3SUHOLPXO2JDNDY5ZERTAVCNFSM6AAAAABFXGLYICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRQHEZDSMJRGM . You are receiving this because you commented.Message ID: @.***>

wycst commented 4 months ago

Hello, compared to the results of the first two high-performance library tests, the results of the just tested run

fastjson2: 2.0.47 dsl.version 2.0.2 wast: 0.0.12.1

# JMH version: 1.36
# VM version: JDK 17.0.3.1, Java HotSpot(TM) 64-Bit Server VM, 17.0.3.1+2-LTS-6
# VM invoker: D:\Program Files\Java\jdk-17.0.3.1\bin\java.exe
# VM options: --add-opens=java.base/java.time=ALL-UNNAMED --add-modules=jdk.incubator.vector -javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2023.1\lib\idea_rt.jar=62683:D:\Program Files\JetBrains\IntelliJ IDEA 2023.1\bin -Dfile.encoding=UTF-8

Benchmark                                     Mode  Cnt        Score        Error  Units
JavaJsonJmhDeserTest.dsljson_deser_client    thrpt    5   631549.154 ±  11858.434  ops/s
JavaJsonJmhDeserTest.fastjson2_deser_client  thrpt    5   680066.404 ±  36023.151  ops/s
JavaJsonJmhDeserTest.wast_deser_client       thrpt    5   905647.903 ±  25700.604  ops/s

JavaJsonJmhSerTest.dsljson_ser_client        thrpt    5  1109871.104 ± 107896.167  ops/s
JavaJsonJmhSerTest.fastjson2_ser_client      thrpt    5  1414414.026 ±  30514.291  ops/s
JavaJsonJmhSerTest.wast_ser_client           thrpt    5  1441172.972 ±  64336.484  ops/s

The original test data can be found in README_2024_04_17_JSON_JMH_RAW.md

fabienrenaud commented 4 months ago

Impressive! I wonder how you got serialization running 50% faster than fastjson. That's huge!

fabienrenaud commented 4 months ago

Please also update the README with the new lib name and version.

wycst commented 4 months ago

Please also update the README with the new lib name and version.

I just updated the new library and version, and I found that the versions of other libraries are not the latest, such as dsl json and fastjson2

wycst commented 4 months ago

Impressive! I wonder how you got serialization running 50% faster than fastjson. That's huge!

Impressive! I wonder how you got serialization running 50% faster than fastjson. That's huge!

It's not that exaggerated, serialization is similar, but deserialization is faster than fastjson2, without using any black technology, only using unsafe and cached reflection. Most of the performance comes from the performance advantages of higher versions of JDK for reading and writing Strings, such as some APIs that add @ IntrinsicCandidate annotations, which cannot be surpassed by any coding techniques.

fabienrenaud commented 4 months ago

Thank you for your contribution!