Skip to content

[Json] Add json reader benchmarks for ListView#9647

Merged
alamb merged 3 commits intoapache:mainfrom
liamzwbao:issue-9646-json-listview-bench
Apr 6, 2026
Merged

[Json] Add json reader benchmarks for ListView#9647
alamb merged 3 commits intoapache:mainfrom
liamzwbao:issue-9646-json-listview-bench

Conversation

@liamzwbao
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Add benchmarks for ListView JSON decoding to establish a performance baseline before refactoring the ListView decoder. Also clean up the existing benchmark file to reduce duplication and improve consistency.

What changes are included in this PR?

Add ListView bench for json_reader

Are these changes tested?

Yes

Are there any user-facing changes?

No

@liamzwbao liamzwbao marked this pull request as ready for review April 1, 2026 14:18
Comment on lines -200 to -217
fn bench_decode_schema(c: &mut Criterion, name: &str, data: &[u8], schema: Arc<Schema>) {
let mut group = c.benchmark_group(name);
group.throughput(Throughput::Bytes(data.len() as u64));
group.sample_size(50);
group.measurement_time(std::time::Duration::from_secs(5));
group.warm_up_time(std::time::Duration::from_secs(2));
group.sampling_mode(SamplingMode::Flat);
group.bench_function(BenchmarkId::from_parameter(ROWS), |b| {
b.iter(|| {
let mut decoder = ReaderBuilder::new(schema.clone())
.with_batch_size(BATCH_SIZE)
.build_decoder()
.unwrap();
decode_and_flush(&mut decoder, data);
})
});
group.finish();
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved to the top

@liamzwbao liamzwbao force-pushed the issue-9646-json-listview-bench branch from 3c610ff to 372885c Compare April 3, 2026 00:28
Copy link
Copy Markdown
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.

Looks good to me -- thank you @liamzwbao

@alamb alamb merged commit 65ad652 into apache:main Apr 6, 2026
23 checks passed
@liamzwbao liamzwbao deleted the issue-9646-json-listview-bench branch April 6, 2026 22:13
alamb pushed a commit that referenced this pull request Apr 15, 2026
… json decoder (#9648)

# 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 #9646.

# 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.
-->

# What changes are included in this PR?

<!--
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.
-->

Support `GenericListViewArray::new_unchecked` and refactor ListView json
decoder. Stacked on #9497, benchmark added in #9647

# Are these changes tested?

<!--
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)?
-->
Covered by existing tests

# Are there any user-facing changes?

<!--
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.
-->

No
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