Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

The capacity of the dict is 2/3 of its hashtable size: dk_usable < 2/3 * 
dk_size.

Currently the dict grows if dk_usable > 1/4 * dk_size, and preserves the size 
if dk_usable < 1/4 * dk_size. Note that it it can grow twice if dk_usable > 1/2 
* dk_size.

With the proposed change the dict will grow only if dk_usable > 1/3 * dk_size, 
preserve the size if 1/6 * dk_size < dk_usable < 1/3 * dk_size, and shrink if 
dk_usable < 1/6 * dk_size. After growing once it will no need to grow again 
until the number of item be increased.

This LGTM.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to