Skip to content

Conversation

@Weijun-H
Copy link
Member

@Weijun-H Weijun-H commented Jan 7, 2026

Which issue does this PR close?

  • Closes #NNN.

Rationale for this change

Add targeted JSON reader benchmarks to track performance for wide objects, hex-encoded binary inputs, and projection workloads.

What changes are included in this PR?

  • Add arrow-json/benches/wide_object.rs for wide-object decode/serialize benchmarks.
  • Add arrow-json/benches/binary_hex.rs for hex string decoding into Binary/FixedSizeBinary/BinaryView.
  • Add arrow-json/benches/wide_projection.rs for full vs projected schema decoding.

Are these changes tested?

No

Are there any user-facing changes?

No

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 7, 2026
@Weijun-H Weijun-H marked this pull request as draft January 7, 2026 17:30
@Weijun-H Weijun-H changed the title feat: add benchmark for decoding and serializing wide JSON objects feat: add benchmark for json parse Jan 7, 2026
c.bench_function("decode_wide_object_i64_json", |b| {
b.iter(|| {
let mut decoder = ReaderBuilder::new(schema.clone())
.with_batch_size(1024)
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend using batch size of 4k or 8k to better mirror production

Also then I would recommend using like 128k input rows perhaps

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @Weijun-H

@Weijun-H Weijun-H marked this pull request as ready for review January 7, 2026 17:42
@alamb alamb changed the title feat: add benchmark for json parse feat: add benchmarks for json parser Jan 7, 2026
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @Weijun-H

Any chance you are willing to make them all a single benchmark (called json-reader.rs)? If not no worries, I can consolidate them as a follow on PR

@Weijun-H Weijun-H force-pushed the json-wide-tabe-bench branch from b0e2f1d to fbf50de Compare January 8, 2026 08:28
@alamb alamb merged commit 73bbfee into apache:main Jan 8, 2026
24 checks passed
@alamb
Copy link
Contributor

alamb commented Jan 8, 2026

Thank you @Weijun-H

Dandandan pushed a commit to Dandandan/arrow-rs that referenced this pull request Jan 15, 2026
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->

- Closes #NNN.

# Rationale for this change

<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->

Add targeted JSON reader benchmarks to track performance for wide
objects, hex-encoded binary inputs, and projection workloads.

# What changes are included in this PR?

- Add `arrow-json/benches/wide_object.rs` for wide-object
decode/serialize benchmarks.
- Add `arrow-json/benches/binary_hex.rs` for hex string decoding into
Binary/FixedSizeBinary/BinaryView.
- Add `arrow-json/benches/wide_projection.rs` for full vs projected
schema decoding.


<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->

# Are these changes tested?
No

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->

# Are there any user-facing changes?
No

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants