diff options
author | Sam Gross <colesbury@gmail.com> | 2024-02-01 09:26:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 09:26:23 (GMT) |
commit | e6d6d5dcc00af50446761b0c4d20bd6e92380135 (patch) | |
tree | 77832c15b67d591317682f916839c78a7f10b0d8 /Python/import.c | |
parent | 5ce193e65a7e6f239337a8c5305895cf8a4d2726 (diff) | |
download | cpython-e6d6d5dcc00af50446761b0c4d20bd6e92380135.zip cpython-e6d6d5dcc00af50446761b0c4d20bd6e92380135.tar.gz cpython-e6d6d5dcc00af50446761b0c4d20bd6e92380135.tar.bz2 |
gh-114746: Avoid quadratic behavior in free-threaded GC (GH-114817)
The free-threaded build's GC implementation is non-generational, but was
scheduled as if it were collecting a young generation leading to
quadratic behavior. This increases the minimum threshold and scales it
to the number of live objects as we do for the old generation in the
default build.
Note that the scheduling is still not thread-safe without the GIL. Those
changes will come in later PRs.
A few tests, like "test_sneaky_frame_object" rely on prompt scheduling
of the GC. For now, to keep that test passing, we disable the scaled
threshold after calls like `gc.set_threshold(1, 0, 0)`.
Diffstat (limited to 'Python/import.c')
0 files changed, 0 insertions, 0 deletions