[Python-Dev] More compact dictionaries with faster iteration

Andrea Griffini agriff at tin.it
Mon Jan 7 09:05:42 CET 2013


On Sun, Jan 6, 2013 at 10:40 PM, Kristján Valur Jónsson
<kristjan at ccpgames.com> wrote:

> A linear lookup in a handful of slots can't be that much of a bother, it is only with larger number of entries that the O(1) property starts to matter.

Something that I was thinking is if for small tables does make sense
to actually do the hashing... a small table could be kept with just
key/value pairs (saving also the hash space) with a linear scan first
for identity and then a second scan for equality.

Given the level of optimization of dicts however I'm 99% sure this was
already tried before tho.


More information about the Python-Dev mailing list