|
18 | 18 | use arrow::datatypes::{DataType, Field, Schema}; |
19 | 19 | use async_trait::async_trait; |
20 | 20 | use bytes::Bytes; |
21 | | -use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main}; |
| 21 | +use criterion::{Criterion, Throughput, criterion_group, criterion_main}; |
22 | 22 | use datafusion_datasource::file::FileSource; |
23 | 23 | use datafusion_datasource::file_groups::FileGroup; |
24 | 24 | use datafusion_datasource::file_scan_config::FileScanConfigBuilder; |
@@ -284,19 +284,17 @@ fn bench_json_boundary(c: &mut Criterion) { |
284 | 284 | let exec_bytes = measure_datasource_exec_bytes(&rt, &fixture); |
285 | 285 |
|
286 | 286 | let mut exec_group = c.benchmark_group("json_boundary_datasource_exec"); |
287 | | - // The read_bytes tag is the primary signal; time reflects simulated CPU cost. |
288 | | - exec_group.bench_function( |
289 | | - BenchmarkId::new("execute", format!("read_bytes={exec_bytes}")), |
290 | | - |b| { |
291 | | - b.iter(|| { |
292 | | - fixture.store.reset(); |
293 | | - rt.block_on(run_datasource_exec( |
294 | | - Arc::clone(&fixture.exec), |
295 | | - Arc::clone(&fixture.task_ctx), |
296 | | - )); |
297 | | - }); |
298 | | - }, |
299 | | - ); |
| 287 | + exec_group.throughput(Throughput::Bytes(exec_bytes)); |
| 288 | + // Fixed benchmark id for baseline comparisons; read_bytes is reported as throughput. |
| 289 | + exec_group.bench_function("execute", |b| { |
| 290 | + b.iter(|| { |
| 291 | + fixture.store.reset(); |
| 292 | + rt.block_on(run_datasource_exec( |
| 293 | + Arc::clone(&fixture.exec), |
| 294 | + Arc::clone(&fixture.task_ctx), |
| 295 | + )); |
| 296 | + }); |
| 297 | + }); |
300 | 298 | exec_group.finish(); |
301 | 299 | } |
302 | 300 |
|
|
0 commit comments