[Python-Dev] More compact dictionaries with faster iteration

Maciej Fijalkowski fijall at gmail.com
Wed May 15 16:31:40 CEST 2013


On Wed, May 15, 2013 at 2:36 PM, Christian Tismer <tismer at stackless.com> wrote:
> On 15.05.13 14:01, Stefan Drees wrote:
>>
>> Hi Chris,
>>
>> On 15.05.13 13:32 Christian Tismer wrote:
>>>
>>> Hi Raymond,
>>>
>>> On 08.01.13 15:49, Maciej Fijalkowski wrote:
>>>>
>>>> On Mon, Dec 10, 2012 at 3:44 AM, Raymond Hettinger
>>>> <raymond.hettinger at gmail.com> wrote:
>>>>>
>>>>> The current memory layout for dictionaries is
>>>>> unnecessarily inefficient.  It has a sparse table of
>>>>> 24-byte entries containing the hash value, key pointer,
>>>>> and value pointer.
>>>>>
>>>>> ...
>>>>
>>>>
>>>
>>> What is the current status of this discussion?
>>> I'd like to know whether it is a considered alternative implementation.
>>>
>>> There is also a discussion in python-ideas right now where this
>>> alternative is mentioned, and I think especially for small dicts
>>> as **kwargs, it could be a cheap way to introduce order.
>>>
>>> Is this going on, somewhere? I'm quite interested on that.
>>
>>
>> +1 I am also interested on the status. Many people seemed to have copied
>> the recipe from the activestate site (was it?) but I wonder if it maybe was
>> to cool to be progressed into "the field" or simply some understandable lack
>> of resources?
>>
>
> Right, found the references:
> http://mail.python.org/pipermail/python-dev/2012-December/123028.html
> http://stackoverflow.com/questions/14664620/python-dictionary-details
> http://code.activestate.com/recipes/578375-proof-of-concept-for-a-more-space-efficient-faster/?in=user-178123
>
>
> cheers - chris
>
> --
> Christian Tismer             :^)   <mailto:tismer at stackless.com>
> Software Consulting          :     Have a break! Take a ride on Python's
> Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
> 14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
> phone +49 173 24 18 776  fax +49 (30) 700143-0023
> PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
>       whom do you want to sponsor today?   http://www.stackless.com/
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/fijall%40gmail.com

I implemented one for pypy btw (it's parked on a branch for messiness reasons)

Cheers,
fijal


More information about the Python-Dev mailing list