-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-114746: Avoid quadratic behavior in free-threaded GC #114817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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)`.
!buildbot nogil |
🤖 New build scheduled with the buildbot fleet by @colesbury for commit 66959ca 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
@itamaro - I think this fixes the nogil Windows build bot timeouts. The "Ubuntu NoGIL Refleaks" buildbot still seems quite slow, but I think that was the case before the GC changes. |
Ubuntu refleaks failed with a transient issue, which looks unrelated:
A re-run passed. But I'm sure the flock issue will come up again, especially when I get around to monitoring re-ran Buildbot tests. |
Thank you for the quick fix! |
…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)`.
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)
.