gh-144960: Clarify GC threshold1 formula in set_threshold docs#145285
Open
Anandesh-Sharma wants to merge 1 commit intopython:mainfrom
Open
gh-144960: Clarify GC threshold1 formula in set_threshold docs#145285Anandesh-Sharma wants to merge 1 commit intopython:mainfrom
Anandesh-Sharma wants to merge 1 commit intopython:mainfrom
Conversation
The documentation stated that the fraction of the old generation scanned is "inversely proportional to threshold1" and that the default value of 10 results in 1% being scanned. However, this was confusing because a naive interpretation of "inversely proportional" (1/threshold1 = 1/10 = 10%) does not match the stated 1%. Clarify by showing the actual formula: 1/(10 * threshold1), which accounts for the internal SCAN_RATE_DIVISOR constant of 10. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The following commit authors need to sign the Contributor License Agreement: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gc.set_threshold()documentation for thethreshold1parameter1/(10 * threshold1)instead of just stating "inversely proportional"SCAN_RATE_DIVISORinPython/gc.cFixes #144960
Test plan
make -C Doc htmlPython/gc.c(SCAN_RATE_DIVISOR = 10)📚 Documentation preview 📚: https://cpython-previews--145285.org.readthedocs.build/