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()`.
This commit is contained in:
Sam Gross 2024-06-05 09:23:29 -04:00 committed by GitHub
parent 5c02ea8bae
commit 4bba1c9e6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -82,7 +82,7 @@ def callback(self, ref):
@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.
"""