]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120065: Increase `collect_in_thread` period to 5 ms. (#120068)
authorSam Gross <colesbury@gmail.com>
Wed, 5 Jun 2024 13:23:29 +0000 (09:23 -0400)
committerGitHub <noreply@github.com>
Wed, 5 Jun 2024 13:23:29 +0000 (09:23 -0400)
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()`.

Lib/test/test_weakref.py

index 16da24d7805b566c09f6eb24d5d62d4bbfb3f324..ef2fe92cc219b639073878cccdf7756d93a78b9a 100644 (file)
@@ -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.
     """