collections.Counter surprisingly slow

Serhiy Storchaka storchaka at gmail.com
Mon Jul 29 15:37:51 EDT 2013


29.07.13 20:19, Ian Kelly написав(ла):
> On Mon, Jul 29, 2013 at 5:49 AM, Joshua Landau <joshua at landau.ws> wrote:
>> Also, couldn't Counter just extend from defaultdict?
>
> It could, but I expect the C helper function in 3.4 will be faster
> since it doesn't even need to call __missing__ in the first place.

I'm surprised, but the Counter constructor with commented out import of 
this accelerator is faster (at least for some data).





More information about the Python-list mailing list