Skip to content

Commit f67eb94

Browse files
committed
Add CARGO_PROFILE support for bench.sh
Document the CARGO_PROFILE override in bench.sh. Include a tip for using release-nonlto and an example dfbench command to achieve faster builds with near-release performance.
1 parent b7026e2 commit f67eb94

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

benchmarks/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ cd ./benchmarks/
4949
./bench.sh
5050
```
5151

52+
To override the Cargo profile used by the script, set `CARGO_PROFILE` (for example, `CARGO_PROFILE=release-nonlto`).
53+
5254
## Generating data
5355

5456
You can create / download the data for these benchmarks using the [bench.sh](bench.sh) script:
@@ -265,6 +267,12 @@ Assuming data is in the `data` directory, the `tpch` benchmark can be run with a
265267
cargo run --release --bin dfbench -- tpch --iterations 3 --path ./data --format tbl --query 1 --batch-size 4096
266268
```
267269

270+
Tip: `--profile release-nonlto` builds significantly faster while staying close to release performance. For example:
271+
272+
```bash
273+
cargo run --profile release-nonlto --bin dfbench -- tpcds --iterations 3 --path ./data --format parquet --query 1
274+
```
275+
268276
See the help for more details.
269277

270278
### Different features

benchmarks/bench.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ COMMAND=
4040
BENCHMARK=all
4141
DATAFUSION_DIR=${DATAFUSION_DIR:-$SCRIPT_DIR/..}
4242
DATA_DIR=${DATA_DIR:-$SCRIPT_DIR/data}
43-
CARGO_COMMAND=${CARGO_COMMAND:-"cargo run --release"}
43+
CARGO_PROFILE=${CARGO_PROFILE:-release}
44+
if [[ -z "${CARGO_COMMAND}" ]]; then
45+
CARGO_COMMAND="cargo run --profile ${CARGO_PROFILE}"
46+
fi
4447
PREFER_HASH_JOIN=${PREFER_HASH_JOIN:-true}
4548
VIRTUAL_ENV=${VIRTUAL_ENV:-$SCRIPT_DIR/venv}
4649

@@ -141,6 +144,7 @@ Supported Configuration (Environment Variables)
141144
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
142145
DATA_DIR directory to store datasets
143146
CARGO_COMMAND command that runs the benchmark binary
147+
CARGO_PROFILE cargo profile to use when CARGO_COMMAND is unset (default release)
144148
DATAFUSION_DIR directory to use (default $DATAFUSION_DIR)
145149
RESULTS_NAME folder where the benchmark files are stored
146150
PREFER_HASH_JOIN Prefer hash join algorithm (default true)

0 commit comments

Comments
 (0)