Skip to content

Commit

Permalink
benchmarks: minor refactor
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
jqnatividad committed Sep 10, 2023
1 parent 17f6298 commit 491e68a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/benchmark-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"

0 comments on commit 491e68a

Please sign in to comment.