Skip to content

Commit b296e78

Browse files
committed
Fix subbenchmark
1 parent e3f75db commit b296e78

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pyperformance/data-files/benchmarks/bm_ctypes/run_benchmark.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ def benchmark(loops):
9090
return pyperf.perf_counter() - t0
9191

9292

93+
def add_cmdline_args(cmd, args):
94+
if args.argtypes:
95+
cmd.append("--argtypes")
96+
97+
9398
if __name__ == "__main__":
94-
runner = pyperf.Runner()
99+
runner = pyperf.Runner(add_cmdline_args=add_cmdline_args)
95100
runner.metadata["description"] = "ctypes function call overhead benchmark"
96101

97102
runner.argparser.add_argument("--argtypes", action="store_true")
@@ -101,4 +106,3 @@ def benchmark(loops):
101106
runner.bench_time_func("ctypes_argtypes", benchmark_argtypes, inner_loops=3)
102107
else:
103108
runner.bench_time_func("ctypes", benchmark, inner_loops=3)
104-

0 commit comments

Comments
 (0)