David Lindquist added the comment:

> other benchmarks show it to be more than twice as slow

Can you share the method you used to get those results? Here's what I did:

$ python -m timeit --number=1000000 --setup="from rr_mine import roundrobin" 
"its = ['ABC', 'D', 'EF']; list(roundrobin(*its))"
1000000 loops, best of 3: 6.59 usec per loop
$ python -m timeit --number=1000000 --setup="from rr_theirs import roundrobin" 
"its = ['ABC', 'D', 'EF']; list(roundrobin(*its))"
1000000 loops, best of 3: 14.4 usec per loop

Using your recommended iterables (reducing the number of executions so it 
completes in my lifetime), the results are much closer, but my version still 
edges out the original:

$ python -m timeit --number=10000 --setup="from rr_mine import roundrobin" "its 
= [range(100)] + [()] * 100; list(roundrobin(*its))"
10000 loops, best of 3: 641 usec per loop
$ python -m timeit --number=10000 --setup="from rr_theirs import roundrobin" 
"its = [range(100)] + [()] * 100; list(roundrobin(*its))"
10000 loops, best of 3: 699 usec per loop

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20727>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to