[Zope3-checkins] Re: SVN: Zope3/trunk/src/zope/tal/ The lists has been changed to dicts for faster membership testing

Fred Drake fdrake at gmail.com
Fri Apr 22 11:23:41 EDT 2005


> Hmm... Dicts is the best.
> 
> List: [3.6132634175572593, 3.6005866667411639, 3.589006144635702]
> Dict: [1.8321392802716545, 1.8291235338569578, 1.8336291344290974]
> Set: [1.9347207536153341, 1.9356901505638291, 1.9329386835477713]
> FrozenSet: [1.9277402574908287, 1.9275427463546357, 1.9276584035121793]

Hmm.  I'll bet that's because we're using string keys.  A dict is
highly optomized to work with strings; lots of games come into play
when a dictionary never sees anything but str objects.

Very cool!


  -Fred

-- 
Fred L. Drake, Jr.    <fdrake at gmail.com>
Zope Corporation


More information about the Zope3-Checkins mailing list