Skip to content

bench.sh: run tpch benchmarks with benchmark_runner - #28040

Open
adriangb wants to merge 1 commit into
apache:mainfrom
adriangb:bench-sh-benchmark-runner-tpch
Open

adriangb wants to merge 1 commit into
apache:mainfrom
adriangb:bench-sh-benchmark-runner-tpch

Conversation

@adriangb

@adriangb adriangb commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Part of #24311. This is the first benchmark. The issue asks for one benchmark per PR.

Rationale for this change

bench.sh run tpch uses the Criterion SQL harness (cargo bench --bench sql). That harness writes no timing JSON, so bench.sh compare has nothing to read for tpch. benchmark_runner in its plain mode runs the same SQL suite with the shared sampler: one discarded warm-up iteration, --iterations, --max-time and lockstep. It writes dfbench-format JSON that compare.py reads.

What changes are included in this PR?

  • A shared run_benchmark_runner helper in bench.sh. It forwards the query argument, SIMULATE_LATENCY, ITERATIONS, MAX_TIME, LOCKSTEP_IN and LOCKSTEP_OUT to benchmark_runner, each only when it is set. These are named variables, not a generic pass-through. Later per-benchmark PRs reuse the helper.
  • run_tpch and run_tpch_mem (tpch, tpch10, tpch_csv, tpch_csv10, tpch_mem, tpch_mem10) use the helper. tpch keeps the dfbench default of 5 iterations.
Benchmark Results file
parquet tpch_sf<N>.json (same name as the dfbench era)
csv tpch_csv_sf<N>.json (before, csv and parquet overwrote each other)
mem tpch_mem_sf<N>.json
  • The README documents the forwarded variables.

cargo bench --bench sql stays usable directly for Criterion runs.

Note for reviewers: query names in the results are the runner's names, for example Qtpch/Q01/sf1. A compare against results that an older dfbench checkout wrote does not pair the queries.

Are these changes tested?

Manually:

  • Two ITERATIONS=2 ./bench.sh run tpch 1 runs on SF 0.01 data under different RESULTS_NAME values, then compare.py on the two files, produced the comparison table.
  • MAX_TIME=1 ./bench.sh run tpch_mem 3 ran adaptively.
  • With CARGO_COMMAND=echo, the printed command has --iterations 5 by default, the ITERATIONS value when set, and the lockstep and latency flags when set.

Are there any user-facing changes?

bench.sh run tpch* writes timing results that bench.sh compare reads. No library changes.

🤖 Generated with Claude Code

`bench.sh run tpch` used the Criterion SQL harness, which writes no
timing JSON, so `bench.sh compare` had nothing to read for tpch. The
benchmark_runner plain mode runs the same SQL suite with the shared
sampler and writes dfbench-format JSON.

Add a `run_benchmark_runner` helper that forwards QUERY,
SIMULATE_LATENCY, ITERATIONS, MAX_TIME, LOCKSTEP_IN and LOCKSTEP_OUT to
benchmark_runner, each only when set. Port run_tpch and run_tpch_mem to
it. The parquet run writes tpch_sf<N>.json as dfbench did, csv writes
tpch_csv_sf<N>.json and mem writes tpch_mem_sf<N>.json. Document the
variables in the benchmarks README.

Part of apache#24311

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant