@@ -7,15 +7,16 @@ MONOREPO_ROOT="$(realpath $(dirname "${PROGNAME}"))"
77function usage() {
88cat << EOF
99Usage:
10- ${PROGNAME} [-h|--help] <baseline-build> <candidate-build> benchmarks...
10+ ${PROGNAME} [-h|--help] <baseline-build> <candidate-build> benchmarks... [-- gbench-args...]
1111
1212Compare the given benchmarks between the baseline and the candidate build directories.
1313
1414This requires those benchmarks to have already been generated in both build directories.
1515
16- <baseline-build> The path to the build directory considered the baseline.
17- <candidate-build> The path to the build directory considered the candidate.
18- benchmarks... Paths of the benchmarks to compare. Those paths are relative to '<monorepo-root>'.
16+ <baseline-build> The path to the build directory considered the baseline.
17+ <candidate-build> The path to the build directory considered the candidate.
18+ benchmarks... Paths of the benchmarks to compare. Those paths are relative to '<monorepo-root>'.
19+ [-- gbench-args...] Any arguments provided after '--' will be passed as-is to GoogleBenchmark's compare.py tool.
1920
2021Example
2122=======
@@ -45,7 +46,17 @@ python3 -m venv /tmp/libcxx-compare-benchmarks-venv
4546source /tmp/libcxx-compare-benchmarks-venv/bin/activate
4647pip3 install -r ${GBENCH} /tools/requirements.txt
4748
48- for benchmark in ${@ } ; do
49+ benchmarks=" "
50+ while [[ $# -gt 0 ]]; do
51+ if [[ " ${1} " == " --" ]]; then
52+ shift
53+ break
54+ fi
55+ benchmarks+=" ${1} "
56+ shift
57+ done
58+
59+ for benchmark in ${benchmarks} ; do
4960 base=" $( ${MONOREPO_ROOT} /libcxx/utils/libcxx-benchmark-json ${baseline} ${benchmark} ) "
5061 cand=" $( ${MONOREPO_ROOT} /libcxx/utils/libcxx-benchmark-json ${candidate} ${benchmark} ) "
5162
@@ -58,5 +69,5 @@ for benchmark in ${@}; do
5869 continue
5970 fi
6071
61- " ${GBENCH} /tools/compare.py" benchmarks " ${base} " " ${cand} "
72+ " ${GBENCH} /tools/compare.py" benchmarks " ${base} " " ${cand} " ${ @ }
6273done
0 commit comments