bpo-33205: dict: Change GROWTH_RATE to (used*3) by methane ยท Pull Request #6350 ยท python/cpython

@methane

@methane 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)

Apr 2, 2018

@methane

serhiy-storchaka

@@ -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?

@methane

@miss-islington

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>

@bedevere-bot

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>