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

Measure performance improvement by "fast double writing" #992

Closed
cowtowncoder opened this issue Apr 20, 2023 · 4 comments
Closed

Measure performance improvement by "fast double writing" #992

cowtowncoder opened this issue Apr 20, 2023 · 4 comments

Comments

@cowtowncoder
Copy link
Member

(note: similar to #970)

Jackson 2.14 added StreamReadFeature.USE_FAST_DOUBLE_WRITER and backing implementation to speed up encoding of floating-point values from JSON (see #749). But we haven't published results (or actually done much in way of measurements).
Let's change that.

Tests to be added to https://github.com/FasterXML/jackson-benchmarks/

@cowtowncoder
Copy link
Member Author

cowtowncoder commented Apr 20, 2023

Interestingly enough we seem to get +20% throughput improvement with JDK 8:

java -Xmx256m -jar target/perf.jar ".*Json.*StdWriteVanilla.writeCurrencyPojo.*" -wi 3 -w 1 -i 5 -r 1 -f 5

Benchmark                                      Mode  Cnt      Score     Error  Units
JsonStdWriteVanilla.writeCurrencyPojoDefault  thrpt   25  56956.808 ± 692.258  ops/s
JsonStdWriteVanilla.writeCurrencyPojoFast     thrpt   25  67980.186 ± 431.886  ops/s

and with JDK 17 slightly more (+25 - 30%)

Benchmark                                      Mode  Cnt      Score      Error  Units
JsonStdWriteVanilla.writeCurrencyPojoDefault  thrpt   25  55172.044 ±  434.920  ops/s
JsonStdWriteVanilla.writeCurrencyPojoFast     thrpt   25  69496.599 ± 1300.986  ops/s

@cowtowncoder
Copy link
Member Author

/cc @pjfanning This wrt discussions on including code. Interestingly enough relatively speed up on writing is bigger than reading for this data set. So it seems like valuable thing to have.

@cowtowncoder
Copy link
Member Author

Will need to find time to blog about the results. Another interesting thing: CBOR backend is about 50% faster than Smile for this case; and about 500% speed of JSON writer. So floating-point handling efficiency matters A LOT on writing.

@cowtowncoder
Copy link
Member Author

Wrote a blog post about results:

https://cowtowncoder.medium.com/jackson-2-15-faster-floating-point-writes-too-19958e310185

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

1 participant