[issue44206] Add a version number to dict keys.

Mark Shannon report at bugs.python.org
Fri May 21 11:42:19 EDT 2021


Mark Shannon <mark at hotpy.org> added the comment:

The memory saving comes from converting:

    Py_ssize_t dk_size;
    dict_lookup_func dk_lookup;

to:

   uint8_t dk_log2_size;
   uint8_t dk_loopup_kind; /* Only 3 possible values */
   uint32_t dk_version;

which saves 8 bytes on a 64 bit machine (no saving on a 32 bit machine).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44206>
_______________________________________


More information about the Python-bugs-list mailing list