File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ #
3+ # run bench for 2 git hash/branch/tag
4+ #
5+ # ./run_bench.sh [baseline] [compare]
6+ # to only run some bench, use EXTRA_ARGS="--bench interleave_kernels \"interleave list struct.*\"" ./run_bench.sh HEAD main
7+
8+ set -e
9+
10+ function patch_cargo_toml() {
11+ if [[ ! -z $( grep " bench = false" arrow/Cargo.toml) ]]; then
12+ echo " Patch not required"
13+ else
14+ echo " Patch required"
15+ cp arrow/Cargo.toml arrow/Cargo.toml.org
16+ sed ' /^\[lib\]/a bench = false' arrow/Cargo.toml.org > arrow/Cargo.toml
17+ fi
18+ }
19+
20+ function run_bench( ) {
21+ cmd=" cargo bench ${EXTRA_ARGS} -- --save-baseline arrow-$1 "
22+ echo $cmd
23+ bash -c " $cmd "
24+ }
25+
26+
27+ # checkout baseline and run bench
28+ git checkout $1
29+
30+ patch_cargo_toml
31+ run_bench $1
32+
33+ # checkout compare and run bench
34+ git reset --hard
35+ git checkout $2
36+
37+ patch_cargo_toml
38+ run_bench $2
You can’t perform that action at this time.
0 commit comments