[issue27350] Compact and ordered dict

STINNER Victor report at bugs.python.org
Sat Sep 10 02:48:15 EDT 2016


STINNER Victor added the comment:

It seems like the memory usage is between 20% and 25% smaller. Great job!

Memory usage, Python 3.5 => Python 3.6 on Linux x86_64:

./python -c 'import sys; print(sys.getsizeof({str(i):i for i in range(10)}))'

* 10 items: 480 B => 384 B (-20%)
* 100 items: 6240 B => 4720 B (-24%)
* 1000 items: 49248 B => 36984 B (-25%)

Note: the size is the the size of the container itself, not of keys nor values.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27350>
_______________________________________


More information about the Python-bugs-list mailing list