Skip to content

Commit a69164f

Browse files
author
Raghuveer Devulapalli
committed
Pass benchmark_repeat through python script
1 parent 4ce73dc commit a69164f

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

run-bench.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
parser.add_argument("-b", '--branch', type=str, default="main", required=False)
88
parser.add_argument('--benchcompare', type=str, help='Compare simd bench with stdsort methods. Requires one of qsort, qselect, partialsort, argsort or argselect')
99
parser.add_argument("-f", '--filter', type=str, required=False)
10+
parser.add_argument("-r", '--repeat', type=int, required=False)
1011
args = parser.parse_args()
1112

1213
if len(sys.argv) == 1:
@@ -15,6 +16,9 @@
1516
filterb = ""
1617
if args.filter is not None:
1718
filterb = args.filter
19+
repeatnum = 1
20+
if args.repeat is not None:
21+
repeatnum = args.repeat
1822

1923
if args.benchcompare:
2024
baseline = ""
@@ -43,11 +47,11 @@
4347
else:
4448
parser.print_help(sys.stderr)
4549
parser.error("ERROR: Unknown argument '%s'" % args.benchcompare)
46-
rc = subprocess.check_call("./scripts/bench-compare.sh '%s' '%s'" % (baseline, contender), shell=True)
50+
rc = subprocess.check_call("./scripts/bench-compare.sh '%s' '%s' '%d'" % (baseline, contender, repeatnum), shell=True)
4751

4852
if args.branchcompare:
4953
branch = args.branch
5054
if args.filter is None:
51-
rc = subprocess.check_call("./scripts/branch-compare.sh '%s'" % (branch), shell=True)
55+
rc = subprocess.check_call("./scripts/branch-compare.sh '%s' '%d'" % (branch, repeatnum), shell=True)
5256
else:
53-
rc = subprocess.check_call("./scripts/branch-compare.sh '%s' '%s'" % (branch, args.filter), shell=True)
57+
rc = subprocess.check_call("./scripts/branch-compare.sh '%s' '%s' '%d'" % (branch, args.filter, repeatnum), shell=True)

scripts/bench-compare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ compare=$(realpath .bench/google-benchmark/tools/compare.py)
1414
meson setup -Dbuild_benchmarks=true --warnlevel 0 --buildtype release builddir-${branch}
1515
cd builddir-${branch}
1616
ninja
17-
$compare filters ./benchexe $1 $2
17+
$compare filters ./benchexe $1 $2 --benchmark_repetitions=$3

scripts/branch-compare.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ build_branch $basebranch
4444
contender=$(realpath ${branch}/builddir/benchexe)
4545
baseline=$(realpath ${basebranch}/builddir/benchexe)
4646

47-
if [ -z "$2" ]; then
47+
if [ -z "$3" ]; then
4848
echo "Comparing all benchmarks .."
49-
$compare benchmarks $baseline $contender
49+
$compare benchmarks $baseline $contender --benchmark_repetitions=$2
5050
else
5151
echo "Comparing benchmark $2 .."
52-
$compare benchmarksfiltered $baseline $2 $contender $2
52+
$compare benchmarksfiltered $baseline $2 $contender $2 --benchmark_repetitions=$3
5353
fi

0 commit comments

Comments
 (0)