@@ -7,15 +7,16 @@ MONOREPO_ROOT="$(realpath $(dirname "${PROGNAME}"))"
7
7
function usage() {
8
8
cat << EOF
9
9
Usage:
10
- ${PROGNAME} [-h|--help] <baseline-build> <candidate-build> benchmarks...
10
+ ${PROGNAME} [-h|--help] <baseline-build> <candidate-build> benchmarks... [-- gbench-args...]
11
11
12
12
Compare the given benchmarks between the baseline and the candidate build directories.
13
13
14
14
This requires those benchmarks to have already been generated in both build directories.
15
15
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.
19
20
20
21
Example
21
22
=======
@@ -45,7 +46,17 @@ python3 -m venv /tmp/libcxx-compare-benchmarks-venv
45
46
source /tmp/libcxx-compare-benchmarks-venv/bin/activate
46
47
pip3 install -r ${GBENCH} /tools/requirements.txt
47
48
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
49
60
base=" $( ${MONOREPO_ROOT} /libcxx/utils/libcxx-benchmark-json ${baseline} ${benchmark} ) "
50
61
cand=" $( ${MONOREPO_ROOT} /libcxx/utils/libcxx-benchmark-json ${candidate} ${benchmark} ) "
51
62
@@ -58,5 +69,5 @@ for benchmark in ${@}; do
58
69
continue
59
70
fi
60
71
61
- " ${GBENCH} /tools/compare.py" benchmarks " ${base} " " ${cand} "
72
+ " ${GBENCH} /tools/compare.py" benchmarks " ${base} " " ${cand} " ${ @ }
62
73
done
0 commit comments