collections.Counter surprisingly slow
Roy Smith
roy at panix.com
Sun Jul 28 17:57:12 EDT 2013
In article <51f5843f$0$29971$c3e8da3$5496439d at news.astraweb.com>,
Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> > Why is count() [i.e. collections.Counter] so slow?
>
> It's within a factor of 2 of test, and 3 of exception or default (give or
> take). I don't think that's surprisingly slow.
It is for a module which describes itself as "High-performance container
datatypes" :-)
More information about the Python-list
mailing list