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

Add json transcoding benchmarks #130

Merged
merged 8 commits into from
Feb 18, 2024
Merged

Add json transcoding benchmarks #130

merged 8 commits into from
Feb 18, 2024

Conversation

Ten0
Copy link
Contributor

@Ten0 Ten0 commented Feb 2, 2024

Resolves #129

Also allows serializing unit as null to enable transcoding (non-hinted deserializers will typically yield unit when encountering null).

Current benchmark results:
(TL;DR going through serde_json seems very slow compared to arrow-json's tailored JSON parser)

json_to_arrow(10000)/arrow-json
                        time:   [3.4072 ms 3.4137 ms 3.4224 ms]

image

json_to_arrow(10000)/serde_json_transcode_arrow-json
                        time:   [32.399 ms 32.532 ms 32.774 ms]

image

json_to_arrow(10000)/serde_json_transcode_serde_arrow
                        time:   [30.906 ms 30.947 ms 30.988 ms]

image

@chmp
Copy link
Owner

chmp commented Feb 3, 2024

Hey @Ten0,

Thanks a lot for the PR. The performance is unfortunate. But good to know. Overall the changes look good to me. I will add a couple of comments to the code. Some meta comments:

  • Not sure how other repos are handling attribution. What would you prefer? My suggestion would be to add "and contributors" to the copyright notice in the license and then maybe add a contributors section in the readme or a separate Authors.md file.
  • As you changed the error messages: one of the tests fail (as the message was not that good to begin with, the change itself fine :))
  • My guess would be that the additional benchmark will confuse the readme update. I will have a look myself and maybe filter out the JSON benchmarks

@chmp
Copy link
Owner

chmp commented Feb 18, 2024

* Not sure how other repos are handling attribution. What would you prefer? My suggestion would be to add "and contributors" to the copyright notice in the license and then maybe add a contributors section in the readme or a separate Authors.md file.
  • The readme include an "and contributors"
* As you changed the error messages: one of the tests fail (as the message was not that good to begin with, the change itself fine :))
  • Fixed
* My guess would be that the additional benchmark will confuse the readme update. I will have a look myself and maybe filter out the JSON benchmarks
  • Fixed

@chmp
Copy link
Owner

chmp commented Feb 18, 2024

@Ten0 in case you're interested. I also added simd_json and rewrote all benchmarks to use the JSON line repr. These are the numbers, I get:

label time [ms] arrow_json serde_arrow (se arrow_json (ser serde_arrow (si serde_arrow (se
arrow_json 8.25 1.00 0.12 0.10 0.06 0.04
serde_arrow (serde_json,transcode) 70.56 8.56 1.00 0.89 0.55 0.33
arrow_json (serde_json,transcode) 79.63 9.66 1.13 1.00 0.62 0.37
serde_arrow (simd_json,transcode) 127.99 15.52 1.81 1.61 1.00 0.60
serde_arrow (serde_json,value) 214.16 25.97 3.03 2.69 1.67 1.00

@chmp chmp merged commit 02f3816 into chmp:main Feb 18, 2024
1 check passed
@chmp
Copy link
Owner

chmp commented Feb 18, 2024

Thanks for PR!

@Ten0
Copy link
Contributor Author

Ten0 commented Feb 18, 2024

Thanks for closing it out! 😊

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.

Benchmark serde_json + serde_arrow vs arrow_json
2 participants