Skip to content

Commit

Permalink
[3.13] pythongh-120065: Increase collect_in_thread period to 5 ms. (p…
Browse files Browse the repository at this point in the history
…ythonGH-120068) (python#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 4bba1c9)

Co-authored-by: Sam Gross <colesbury@gmail.com>
  • Loading branch information
miss-islington and colesbury authored Jun 5, 2024
1 parent 8e0c80a commit f561258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_weakref.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down

0 comments on commit f561258

Please sign in to comment.