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

Maciej Fijalkowski fijall at gmail.com
Sat Jan 5 22:03:42 CET 2013


On Sat, Jan 5, 2013 at 1:34 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:

On Thu, 3 Jan 2013 12:22:27 +0200 Maciej Fijalkowski <fijall at gmail.com> wrote:

Hello everyone.

Thanks raymond for writing down a pure python version ;-) I did an initial port to RPython for experiments. The results (on large dicts only) are inconclusive - it's either a bit faster or a bit slower, depending what exactly you do. There is a possibility I messed something up too (there is a branch rdict-experiments in PyPy, in a very sorry state though). But what about the memory consumption? This seems to be the main point of Raymond's proposal.

Er. The memory consumption can be measured on pen and paper, you don't actually need to see right?

After a lot more experimentation I came up with something that behaves better for large dictionaries. This was for a long time a weak point of PyPy, because of some GC details. So I guess I'll try to implement it fully and see how it goes. Stay tuned, I'll keep you posted.

PS. PyPy does not have lots of small dictionaries because of maps (so you don't have a dict per instance), hence their performance is not at all that interesting for PyPy.

Cheers, fijal



More information about the Python-Dev mailing list