bpo-33205: dict: Change GROWTH_RATE to (used*3) by methane ยท Pull Request #6350 ยท python/cpython
methane
changed the title
bpo-33205: dict: Change GROWTH_RATE from (used*2 + capacity/2) to (used*3)
bpo-33205: dict: Change GROWTH_RATE to (used*3)
| @@ -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)``. | |||
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.
| * 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 |
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.
๐๐โ๐ค I'm not a witch! I'm not a witch!
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Apr 17, 2018(cherry picked from commit 5fbc511) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
miss-islington added a commit that referenced this pull request
Apr 17, 2018(cherry picked from commit 5fbc511) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
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