From 55c1309ee618d624bf217454b751467553115d29 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Mon, 13 Jun 2022 08:52:50 -0400 Subject: [PATCH] Move range out of the loop --- .../data-files/benchmarks/bm_ctypes/run_benchmark.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyperformance/data-files/benchmarks/bm_ctypes/run_benchmark.py b/pyperformance/data-files/benchmarks/bm_ctypes/run_benchmark.py index 1e640485..08fc4911 100644 --- a/pyperformance/data-files/benchmarks/bm_ctypes/run_benchmark.py +++ b/pyperformance/data-files/benchmarks/bm_ctypes/run_benchmark.py @@ -60,10 +60,12 @@ def benchmark(loops): void_foo_int_int_int_int = ext.void_foo_int_int_int_int void_foo_constchar = ext.void_foo_constchar + range_it = range(loops) + # Test calling the functions using the implied arguments mechanism t0 = pyperf.perf_counter() - for i in range(loops): + for _ in range_it: void_foo_void() int_foo_int(1) void_foo_int(1)