Skip to content

[Json] Add benchmarks for list json reader#9507

Open
liamzwbao wants to merge 2 commits intoapache:mainfrom
liamzwbao:issue-9497-list-json-reader-bench
Open

[Json] Add benchmarks for list json reader#9507
liamzwbao wants to merge 2 commits intoapache:mainfrom
liamzwbao:issue-9497-list-json-reader-bench

Conversation

@liamzwbao
Copy link
Contributor

@liamzwbao liamzwbao commented Mar 5, 2026

Which issue does this PR close?

Rationale for this change

Add benchmark for ListArray in json_reader to support the performance evaluation of #9497

What changes are included in this PR?

  • Benchmarks for decoding and serialize json list to ListArray.
  • Benchmarks for ListArray and FixedSizeListArray json writer

Are these changes tested?

Benchmarks only

Are there any user-facing changes?

No

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 5, 2026
@liamzwbao liamzwbao marked this pull request as ready for review March 5, 2026 01:37
@liamzwbao liamzwbao force-pushed the issue-9497-list-json-reader-bench branch from 7219290 to cfaea69 Compare March 5, 2026 01:59
group.throughput(Throughput::Elements(ROWS as u64));
group.bench_function("short", |b| {
b.iter(|| {
let mut buf = Vec::with_capacity(ROWS * LIST_SHORT_ELEMENTS * 8);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth extracting this Vec allocation out of the benchmark code, and instead reusing the same buffer with .clear(), to keep the benchmark focused on the speed of the actual writing?

// Long lists: tests child element encode throughput (many elements per row)
group.bench_function("long", |b| {
b.iter(|| {
let mut buf = Vec::with_capacity(ROWS * LIST_LONG_ELEMENTS * 8);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above: extract allocation?


group.bench_function("short", |b| {
b.iter(|| {
let mut buf = Vec::with_capacity(ROWS * LIST_SHORT_ELEMENTS * 8);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above: extract allocation?


group.bench_function("long", |b| {
b.iter(|| {
let mut buf = Vec::with_capacity(ROWS * LIST_LONG_ELEMENTS * 8);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above: extract allocation?

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