Skip to content

bench: add a build-heavy hj benchmark - #27766

Open
2010YOUY01 wants to merge 1 commit into
apache:mainfrom
2010YOUY01:bench-hj-heavy-build
Open

2010YOUY01 wants to merge 1 commit into
apache:mainfrom
2010YOUY01:bench-hj-heavy-build

Conversation

@2010YOUY01

Copy link
Copy Markdown
Member

Which issue does this PR close?

Addresses the benchmark request in this review comment on #27746.

Rationale for this change

Add a build-heavy query to hj benchmark, which is not covered before.

What changes are included in this PR?

  1. Add optional setup SQL to the legacy dfbench hj runner. Setup runs once before timing, keeping build-key generation outside the measured query.
  2. Add Q29 to hj benchmark

The setup hook is a temporary hack to iterate faster on #27746. Long term, HJ should move to benchmark_runner, which already supports load and init. That migration is tracked in #24311.

Here it shows that asof join uses new benchmark_runner, while hj is on legacy dfbench runner

datafusion/benchmarks/bench.sh

Lines 1782 to 1796 in 4c7a78b

# Runs the ASOF join benchmark
run_asof_join() {
RESULTS_FILE="${RESULTS_DIR}/asof_join.json"
echo "RESULTS_FILE: ${RESULTS_FILE}"
echo "Running ASOF join benchmark..."
debug_run $CARGO_COMMAND --bin benchmark_runner -- asof_join --iterations 5 --path "${DATA_DIR}" -o "${RESULTS_FILE}" ${QUERY_ARG} ${LATENCY_ARG}
}
# Runs the nlj benchmark
run_nlj() {
RESULTS_FILE="${RESULTS_DIR}/nlj.json"
echo "RESULTS_FILE: ${RESULTS_FILE}"
echo "Running nlj benchmark..."
debug_run $CARGO_COMMAND --bin dfbench -- nlj --iterations 5 -o "${RESULTS_FILE}" ${QUERY_ARG} ${LATENCY_ARG}
}

What is the testing strategy for this PR?

Tested locally:

yongting@Yongtings-MacBook-Pro-2 ~/C/datafusion (main *=)> CARGO_COMMAND="cargo run --profile release-nonlto" ./benchmarks/bench.sh run hj

...

Query 29 iteration 0 returned 1 rows in 43.312791ms
Query 29 iteration 1 returned 1 rows in 21.864583ms
Query 29 iteration 2 returned 1 rows in 21.207541ms
Query 29 iteration 3 returned 1 rows in 22.798875ms
Query 29 iteration 4 returned 1 rows in 22.740042ms

Are there any user-facing changes?

No

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