-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
bpo-33205: dict: Change GROWTH_RATE to (used*3) #6350
Conversation
@@ -0,0 +1,2 @@ | |||
Change dict growth function from ``round_up_to_power_2(used*2+capacity/2)`` to ``round_up_to_power_2(used*3)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use "hashtable_size" instead if "capacity". The capacity is only 2/3 of the hashtable size.
Objects/dictobject.c
Outdated
* This means that dicts double in size when growing without deletions, | ||
* but have more head room when the number of deletions is on a par with the | ||
* number of insertions. | ||
* number of insertions. See also bpo-17563 and bpo-33205. | ||
* Raising this to used*4 doubles memory consumption depending on the size of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this note still relevant?
Thanks @methane for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
(cherry picked from commit 5fbc511) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
GH-6503 is a backport of this pull request to the 3.7 branch. |
https://bugs.python.org/issue33205