mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-46845: Reduce dict size when all keys are Unicode (GH-31564)
This commit is contained in:
parent
21099fc064
commit
9833bb91e4
9 changed files with 884 additions and 491 deletions
|
|
@ -404,6 +404,11 @@ Optimizations
|
|||
larger *k*).
|
||||
(Contributed by Serhiy Storchaka in :issue:`37295`.)
|
||||
|
||||
* Dict don't store hash value when all inserted keys are Unicode objects.
|
||||
This reduces dict size. For example, ``sys.getsizeof(dict.fromkeys("abcdefg"))``
|
||||
becomes 272 bytes from 352 bytes on 64bit platform.
|
||||
(Contributed by Inada Naoki in :issue:`46845`.)
|
||||
|
||||
|
||||
CPython bytecode changes
|
||||
========================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue