From 0601271fea72db33c308181ef9c3166ab78906f6 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 8 Aug 2023 15:21:48 -0700 Subject: [PATCH] Run mypy the correct number of times --- benchmarks/bm_mypy2/run_benchmark.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/bm_mypy2/run_benchmark.py b/benchmarks/bm_mypy2/run_benchmark.py index 535b9af..9fcfc4f 100644 --- a/benchmarks/bm_mypy2/run_benchmark.py +++ b/benchmarks/bm_mypy2/run_benchmark.py @@ -40,7 +40,7 @@ def _bench_mypy(loops=20, *, legacy=False): elapsed = 0 times = [] with open(os.devnull, "w") as devnull: - for i in range(loops): + for i in range(loops + 1): # This is a macro benchmark for a Python implementation # so "elapsed" covers more than just how long main() takes. t0 = pyperf.perf_counter() @@ -53,7 +53,7 @@ def _bench_mypy(loops=20, *, legacy=False): # Don't include results from the first run, since it loads the # files from disk. Subsequent runs will use the file contents in an # in-memory cache. - if i > 1: + if i > 0: elapsed += t1 - t0 times.append(t0) times.append(pyperf.perf_counter())