Skip to content

Commit 5e3045f

Browse files
authored
More minor benchmarking improvements (#3128)
1 parent bc28f59 commit 5e3045f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

bench-vortex/src/bin/tpch.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ use bench_vortex::{
2020
BenchmarkDataset, Engine, Format, Target, ddb, default_env_filter, vortex_panic,
2121
};
2222
use clap::{Parser, ValueEnum, value_parser};
23+
use datafusion::execution::context::SessionContext;
24+
use datafusion::physical_plan::execution_plan::ExecutionPlan;
2325
use datafusion::physical_plan::metrics::{Label, MetricsSet};
24-
use datafusion::prelude::SessionContext;
25-
use datafusion_physical_plan::ExecutionPlan;
2626
use indicatif::ProgressBar;
2727
use itertools::Itertools;
2828
use log::{info, warn};
@@ -266,14 +266,16 @@ async fn benchmark_datafusion_query(
266266
query_string: &[String],
267267
iterations: usize,
268268
context: &SessionContext,
269-
) -> (Duration, Arc<dyn ExecutionPlan>) {
269+
) -> (usize, Duration, Arc<dyn ExecutionPlan>) {
270+
let mut row_count = usize::MAX;
270271
let mut fastest_run = Duration::from_millis(u64::MAX);
271272
let mut plan_result = None;
272273

273274
for _ in 0..iterations {
274275
let start = Instant::now();
275-
let plan = run_tpch_query(context, query_string, query_idx).await.1;
276+
let (q_row_count, plan) = run_tpch_query(context, query_string, query_idx).await;
276277
let elapsed = start.elapsed();
278+
row_count = q_row_count;
277279

278280
if plan_result.is_none() {
279281
plan_result = Some(plan.clone());
@@ -283,6 +285,7 @@ async fn benchmark_datafusion_query(
283285
}
284286

285287
(
288+
row_count,
286289
fastest_run,
287290
plan_result.vortex_expect("Execution plan must be set"),
288291
)
@@ -359,12 +362,10 @@ async fn bench_main(
359362

360363
for (query_idx, sql_queries) in tpch_queries.clone() {
361364
// Run benchmark as an async function
362-
let (fastest_run, plan) =
365+
let (row_count, fastest_run, plan) =
363366
benchmark_datafusion_query(query_idx, &sql_queries, iterations, &ctx).await;
364367

365-
// Row count verification
366-
let first_row_count = run_tpch_query(&ctx, &sql_queries, query_idx).await.0;
367-
row_counts.push((query_idx, format, first_row_count));
368+
row_counts.push((query_idx, format, row_count));
368369

369370
// Gather metrics.
370371
for (idx, metrics_set) in VortexMetricsFinder::find_all(plan.as_ref())

bench-vortex/src/engines/df/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,9 @@ pub fn write_execution_plan(
150150
format!("{dataset_name}_{format}_q{query_idx:02}.short.plan"),
151151
format!(
152152
"{}",
153-
DisplayableExecutionPlan::with_full_metrics(execution_plan)
153+
DisplayableExecutionPlan::with_metrics(execution_plan)
154154
.set_show_schema(true)
155-
.set_show_statistics(true)
156-
.indent(true)
155+
.indent(false)
157156
),
158157
)
159158
.expect("Unable to write file");

0 commit comments

Comments
 (0)