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

Lists serialization benchmarks #270

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

rutkowskij
Copy link
Contributor

Observed Performance Degradation During Deserialization of Objects with Large Collections

I have observed a significant performance degradation when deserializing objects that contain large collections (lists). In my case, the deserialization time increased by nearly 3x 🧐
Interestingly, when deserializing previously created generic objects, the performance drop is not as noticeable. The most significant difference compared to the previous version is for objects serialized with version 2.1.1 and deserialized with version 2.1.1.
I added benchmarks on my local branch to measure the performance in version 1.10.1 and compared it to the current implementation (entries with name Avro4kV1*). I created a very simple model that contained just an Int list, and the performance drop was already noticeable.
I have added the results to the README for comparison. The remaining results (for v2) are comparable to those in the README on my machine, so I think I can include the results for reference.
Interestingly, there was a strange and intriguing result for JacksonAvro serialization (the fastests one). I’m not sure how to interpret it at this moment, but this effect does not seem to occur with more complex models than just an Int list.

Comment on lines +55 to +56
c.g.a.b.lists.Avro4kListsBenchmark.read thrpt 5 412.503 ± 6.127 ops/s -13.16%
c.g.a.b.lists.JacksonAvroListsBenchmark.read thrpt 5 1002.527 ± 23.039 ops/s +111.09%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the results on my computer using the new kotlinx-io decoder, doubling the performances!! Still not better than jackson, but it's close!

Suggested change
c.g.a.b.lists.Avro4kListsBenchmark.read thrpt 5 412.503 ± 6.127 ops/s -13.16%
c.g.a.b.lists.JacksonAvroListsBenchmark.read thrpt 5 1002.527 ± 23.039 ops/s +111.09%
c.g.a.b.lists.Avro4kListsBenchmark.read thrpt 5 813.448 ± 19.265 ops/s
c.g.a.b.lists.JacksonAvroListsBenchmark.read thrpt 5 972.243 ± 59.303 ops/s

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

Successfully merging this pull request may close these issues.

2 participants