[Python-Dev] More compact dictionaries with faster iteration (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Tue Dec 11 10:15:38 CET 2012


Le Tue, 11 Dec 2012 08:41:32 +0000, Mark Shannon <mark at hotpy.org> a écrit :

> > If you have a suggested allocation pattern or other > constructive suggestion, it would be would welcome. It seems like a reasonable starting point. Trying to avoid resizing the index array and the entries array at the same time is probably a good idea.

Why would you want to avoid that? If we want to allocate the dict's data as a single memory block (which saves a bit in memory consumption and also makes dict allocations faster), we need to resize both arrays at the same time.

Regards

Antoine.



More information about the Python-Dev mailing list