Dictionary, integer compression
Diez B. Roggisch
deets at nospam.web.de
Thu Apr 30 13:26:22 CEST 2009
> Yes, "integer compression" as in Unary, Golomb, and there are a few
> other schemes.
> It is known that for large (integer) data sets, encoding and decoding
> the integers will save space (memory and/or storage) and doesn't
> impact performance.
> As the Python dictionary is a built-in (and an important data
> structure), I wondered if the Python internals used integer
> compression for the dictionary (especially as the size of the
> dictionary grew)?
I doubt that, as even integers are python-objects that might be reused. Thus
every integer-entry costs at least sizeof(void*) bytes.
More information about the Python-list