Skip to content

Instantly share code, notes, and snippets.

@valarauca
Forked from ckampfe/bench_commits.sh
Last active December 3, 2020 02:13
Show Gist options
  • Save valarauca/282c397a92e7a3efd05cc84811f38131 to your computer and use it in GitHub Desktop.
Save valarauca/282c397a92e7a3efd05cc84811f38131 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
shopt -slastpipe
declare -i last_n="${1}"
git log -n $last_n | awk '$1 == "commit" { print $2 }' | readarray -t commits
for commit in "${commits[@]}"
do
git checkout "$commit" &>/dev/null
cargo clean &>/dev/null
RUSTFLAGS="-C target-cpu=native" cargo install --path . --force &>/dev/null
hyperfine -w1 -r3 "jindex ~/code/sf-city-lots-json/citylots.json > /dev/null" |
awk -v commit="$commit" '$1 == "Time" { print commit, "\t", $5 }'
done
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment