[Python-Dev] A new dictionary implementation

Mark Shannon mark at hotpy.org
Sun Jan 29 11:31:48 CET 2012


Hi,

Now that issue 13703 has been largely settled,
I want to propose my new dictionary implementation again.
It is a little more polished than before.

https://bitbucket.org/markshannon/hotpy_new_dict

Object-oriented benchmarks use considerably less memory and are
sometimes faster (by a small amount).
(I've only benchmarked on my old 32bit machine)

E.g   2to3  No speed change  -28% memory
     GCbench   +10% speed     -47% memory

Other benchmarks show little or no change in behaviour,
mainly minor memory savings.

If an application is OO and uses lots of memory
the new dict will save a lot of memory and maybe boost performance.
Other applications will be largely unaffected.

It passes all the tests.
(I had to change a couple that relied on dict repr() ordering)

Cheers,
Mark.


More information about the Python-Dev mailing list