Generator slower than iterator?

Federico Moreira federico at linux.com.uy
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: <http://mail.python.org/pipermail/python-list/attachments/20081219/83de4ce6/attachment.html>


More information about the Python-list mailing list