summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-05 13:46:17 (GMT)
committerGitHub <noreply@github.com>2024-06-05 13:46:17 (GMT)
commitf561258efd944a1d6a0857ef1a0f171da989ed58 (patch)
tree6ebf9c9f0357f833904117da4677762fc1db4f4d
parent8e0c80a4866c82e9841b787da654cb71dfc49341 (diff)
downloadcpython-f561258efd944a1d6a0857ef1a0f171da989ed58.zip
cpython-f561258efd944a1d6a0857ef1a0f171da989ed58.tar.gz
cpython-f561258efd944a1d6a0857ef1a0f171da989ed58.tar.bz2
[3.13] gh-120065: Increase `collect_in_thread` period to 5 ms. (GH-120068) (#120110)
This matches the default GIL switch interval. It greatly speeds up the free-threaded build: previously, it spent nearly all its time in `gc.collect()`. (cherry picked from commit 4bba1c9e6cfeaf69302b501a4306668613db4b28) Co-authored-by: Sam Gross <colesbury@gmail.com>
-rw-r--r--Lib/test/test_weakref.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 16da24d..ef2fe92 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -82,7 +82,7 @@ class TestBase(unittest.TestCase):
@contextlib.contextmanager
-def collect_in_thread(period=0.0001):
+def collect_in_thread(period=0.005):
"""
Ensure GC collections happen in a different thread, at a high frequency.
"""