Generator slower than iterator?

Federico Moreira federico at
Fri Dec 19 14:29:25 CET 2008

Great, 2min 34 secs with the open method =)

but why?

ip, sep, rest = line.partition(' ')
       match_counter[ip] += 1

instead of

match_counter[line.strip()[0]] += 1

strip really takes more time than partition?

I'm having the same results with both of them right now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list