Message212161
> 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 |
|
Date |
User |
Action |
Args |
2014-02-25 05:16:51 | david.lindquist | set | recipients:
+ david.lindquist, rhettinger, larry, docs@python, gdr@garethrees.org |
2014-02-25 05:16:51 | david.lindquist | set | messageid: <1393305411.04.0.513276484335.issue20727@psf.upfronthosting.co.za> |
2014-02-25 05:16:51 | david.lindquist | link | issue20727 messages |
2014-02-25 05:16:50 | david.lindquist | create | |
|