Performance: sets vs dicts.

Raymond Hettinger python at rcn.com
Mon Aug 30 02:25:12 EDT 2010


On Aug 29, 12:12 pm, John Nagle <na... at animats.com> wrote:
>     Is the "in" test faster for a dict or a set?
> Is "frozenset" faster than "set"?  Use case is
> for things like applying "in" on a list of 500 or so words
> while checking a large body of text.

There is no significant difference.
All three are implemented using substantially the same code.


Raymond




More information about the Python-list mailing list