From 491e68aaf6cc8a39f7908b751bb9e6789f41be0a Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sat, 9 Sep 2023 23:59:28 -0400 Subject: [PATCH] `benchmarks`: minor refactor First batch of changes so we can have an updated benchmark table, and benchmark generation bult into release process - update comments - add ability to change 7z bin name - suppress hyperfine output by setting --style to none [skip ci] --- scripts/benchmark-basic.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/benchmark-basic.sh b/scripts/benchmark-basic.sh index bd7416bb0..e50833a4c 100755 --- a/scripts/benchmark-basic.sh +++ b/scripts/benchmark-basic.sh @@ -7,7 +7,7 @@ # significant regressions. # # Make sure you're using a release-optimized `qsv - generated by -# `cargo build --release`; `cargo install qsv`; or `cargo install --path .` +# `cargo build --release --locked`; `cargo install --locked qsv`; or `cargo install --locked --path .` # issued from the root of your qsv git repo. # # This shell script has been tested on Linux, macOS and Cygwin for Windows. @@ -20,7 +20,9 @@ set -e pat="$1" -bin_name=./qsv +bin_name=qsv +# set sevenz_bin_name to "7z" on Windows/Linux and "7zz" on macOS +sevenz_bin_name=7z datazip=/tmp/NYC_311_SR_2010-2020-sample-1M.7z data=NYC_311_SR_2010-2020-sample-1M.csv data_idx=NYC_311_SR_2010-2020-sample-1M.csv.idx @@ -34,7 +36,7 @@ jql='"features".[0]."properties"."label"' if [ ! -r "$data" ]; then printf "Downloading benchmarking data...\n" curl -sS https://raw.githubusercontent.com/wiki/jqnatividad/qsv/files/NYC_311_SR_2010-2020-sample-1M.7z > "$datazip" - 7z e -y "$datazip" + "$sevenz_bin_name" e -y "$datazip" "$bin_name" sample --seed 42 1000 "$data" -o "$data_to_exclude" printf "homeless\npark\nnoise\n" > "$searchset_patterns" fi @@ -164,12 +166,12 @@ run sql "$bin_name" sqlp "$data" city.csv "'select * from _t_1 join _t_2 on _t_ if [ ${#commands_without_index[@]} -gt 0 ]; then - hyperfine --warmup 2 -i --export-json without_index_results.json "${commands_without_index[@]}" + hyperfine --warmup 2 -i --export-json without_index_results.json --style none "${commands_without_index[@]}" fi # Now, run hyperfine with commands_with_index and export to with_index_results.csv if [ ${#commands_with_index[@]} -gt 0 ]; then - hyperfine --warmup 2 -i --export-json with_index_results.json "${commands_with_index[@]}" + hyperfine --warmup 2 -i --export-json with_index_results.json --style none "${commands_with_index[@]}" fi echo "Benchmark results completed"