Skip to content

Commit 130c787

Browse files
committed
feat: add projection support to schema decoding benchmark
1 parent d0da5a5 commit 130c787

File tree

2 files changed

+10
-127
lines changed

2 files changed

+10
-127
lines changed

arrow-json/benches/json-reader.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,13 @@ fn bench_binary_hex(c: &mut Criterion) {
179179
bench_decode_binary(c, "decode_binary_view_hex_json", &binary_data, view_field);
180180
}
181181

182-
fn bench_decode_schema(c: &mut Criterion, name: &str, data: &[u8], schema: Arc<Schema>) {
182+
fn bench_decode_schema(
183+
c: &mut Criterion,
184+
name: &str,
185+
data: &[u8],
186+
schema: Arc<Schema>,
187+
projection: bool,
188+
) {
183189
let mut group = c.benchmark_group(name);
184190
group.throughput(Throughput::Bytes(data.len() as u64));
185191
group.sample_size(50);
@@ -190,6 +196,7 @@ fn bench_decode_schema(c: &mut Criterion, name: &str, data: &[u8], schema: Arc<S
190196
b.iter(|| {
191197
let mut decoder = ReaderBuilder::new(schema.clone())
192198
.with_batch_size(BATCH_SIZE)
199+
.with_projection(projection)
193200
.build_decoder()
194201
.unwrap();
195202
decode_and_flush(&mut decoder, data);
@@ -228,6 +235,7 @@ fn bench_wide_projection(c: &mut Criterion) {
228235
"decode_wide_projection_full_json",
229236
&wide_projection_data,
230237
full_schema,
238+
false,
231239
);
232240

233241
// Projected schema: only 3 fields (f0, f10, f50) out of 100
@@ -237,6 +245,7 @@ fn bench_wide_projection(c: &mut Criterion) {
237245
"decode_wide_projection_narrow_json",
238246
&wide_projection_data,
239247
projected_schema,
248+
true,
240249
);
241250
}
242251

arrow-json/benches/reader.rs

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)