Skip to content

Instantly share code, notes, and snippets.

@mattjj
Created March 18, 2021 00:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattjj/0145392a1141f068f72f5ea096e90908 to your computer and use it in GitHub Desktop.
Save mattjj/0145392a1141f068f72f5ea096e90908 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
current_branch=$(git branch --show-current)
base=${1:-master}
alt=${2:-${current_branch}}
bench=${3:-benchmarks/api_benchmark.py}
rest="${@:4}"
git checkout ${base}
python ${bench} --benchmark_format=json --benchmark_out=${base}.json ${rest}
git checkout ${alt}
python ${bench} --benchmark_format=json --benchmark_out=${alt}.json ${rest}
~/packages/benchmark/tools/compare.py benchmarks ${base}.json ${alt}.json
git checkout ${current_branch}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment