Skip to content

Commit 4bba1c9

Browse files
authored
gh-120065: Increase collect_in_thread period to 5 ms. (#120068)
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()`.
1 parent 5c02ea8 commit 4bba1c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_weakref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def callback(self, ref):
8282

8383

8484
@contextlib.contextmanager
85-
def collect_in_thread(period=0.0001):
85+
def collect_in_thread(period=0.005):
8686
"""
8787
Ensure GC collections happen in a different thread, at a high frequency.
8888
"""

0 commit comments

Comments
 (0)