From 55f497ef055f2ff4b89740acff8cd3cb5f5ba62e Mon Sep 17 00:00:00 2001 From: frostedoyster Date: Tue, 14 Nov 2023 09:34:40 +0100 Subject: [PATCH] Add `gc.disable()` to benchmarks --- python/mops/benchmarks/benchmark.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/mops/benchmarks/benchmark.py b/python/mops/benchmarks/benchmark.py index 0fe07b1..7ba4146 100644 --- a/python/mops/benchmarks/benchmark.py +++ b/python/mops/benchmarks/benchmark.py @@ -1,3 +1,4 @@ +import gc import math import time @@ -6,6 +7,8 @@ def benchmark(function, repeats=1000, warmup=10, plot=True): + gc.disable() + for _ in range(warmup): function()