Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
check-latest: false
- name: Run Benchmarks
if: github.event_name != 'push'
run: bash ci/scripts/bench.sh $(pwd) --json
run: bash ci/scripts/bench.sh $(pwd) -json
- name: Upload results
if: github.event_name == 'push' && github.repository == 'apache/arrow-go' && github.ref_name == 'main'
env:
Expand Down
17 changes: 13 additions & 4 deletions ci/scripts/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# specific language governing permissions and limitations
# under the License.

# this will output the benchmarks to STDOUT but if `-json` is passed
# as the second argument, it will create a file "bench_stats.json"
# this will output the benchmarks to STDOUT but if `-json` or `--json` is
# passed as an argument, it will create a file "bench_stats.json"
# in the directory this is called from containing a json representation

set -ex
Expand All @@ -30,6 +30,15 @@ if [ -z "$1" ]; then
fi

source_dir="$1"
json_requested=false

for arg in "$@"; do
case "$arg" in
-json|--json)
json_requested=true
;;
esac
done

PARQUET_TEST_DATA="${source_dir}/parquet-testing/data"
export PARQUET_TEST_DATA
Expand All @@ -43,8 +52,8 @@ go test -bench=. -benchmem -timeout 40m -run=^$ ./... | tee bench_stat.dat

popd

if [[ "$2" = "-json" ]]; then
go install go.bobheadxi.dev/gobenchdata@latest
if [[ "${json_requested}" == "true" ]]; then
go install go.bobheadxi.dev/gobenchdata@v1.3.1
PATH=$(go env GOPATH)/bin:$PATH
export PATH
cat "${source_dir}"/bench_*.dat | gobenchdata --json bench_stats.json
Expand Down