Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge performance diff between dsljson and dsljson_reflection of serialization. #107

Open
ZhaiMo15 opened this issue Jul 17, 2024 · 2 comments

Comments

@ZhaiMo15
Copy link

I ran the benchmark of serialization, but the result seemed wield, I'd like to know why.

Command: ./run ser --libs jackson,dsljson,dsljson_reflection --apis databind
CPU: Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz
JMH info:

# JMH version: 1.35
# VM version: JDK 17.0.7-internal, OpenJDK 64-Bit Server VM, 17.0.7-internal+7
# VM invoker: /media/disk4/zhaimo03/project/jdk17u/build/linux-x86_64-server-release/images/jdk/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: 55 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time

The result:

Benchmark                           Mode  Cnt         Score        Error  Units
Serialization.dsljson              thrpt   20  10941062.256 ± 107016.443  ops/s
Serialization.dsljson_reflection   thrpt   20   2246216.591 ± 214208.652  ops/s
Serialization.jackson              thrpt   20   5412225.364 ±  50381.440  ops/s

However the result in README shows:

Benchmark                           Mode  Cnt         Score        Error  Units
Serialization.dsljson              thrpt   20  1109612.051 ± 17248.711  ops/s
Serialization.dsljson_reflection   thrpt   20   801809.514 ± 6651.390  ops/s
Serialization.jackson              thrpt   20   668196.151 ±  1980.009  ops/s

I'm wondering why the performance of dsljson_reflection doesn't match? Thanks all.

@SentryMan
Copy link
Contributor

I'd guess because one uses reflection and the other doesn't

@ZhaiMo15
Copy link
Author

Thanks for reply, but see the score, in README, reflection is still better than jackson. However, my bench shows reflection is way to slower than jackson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants