[Python-Dev] More compact dictionaries with faster iteration

Armin Rigo arigo at tunes.org
Sat Jan 3 17:39:10 CET 2015


Hi all,

On 1 January 2015 at 14:52, Maciej Fijalkowski <fijall at gmail.com> wrote:
> PS. I wonder who came up with the idea first, PHP or rhettinger and
> who implemented it first (I'm pretty sure it was used in hippy before
> it was used in Zend PHP)

We'd need to look more in detail to that question, but a quick look
made me find this Java code from 2012:

https://code.google.com/r/wassermanlouis-guava/source/browse/guava/src/com/google/common/collect/CompactHashMap.java?name=refs/remotes/gcode-clone/compact-maps

which implements almost exactly the original idea of Raymond.  (It has
a twist because Java doesn't support arrays of (int, int, Object,
Object), and instead encodes it as one array of long and one array of
Objects.  It also uses a chain of buckets instead of open addressing.)


A bientôt,

Armin.


More information about the Python-Dev mailing list