Message350179
Thanks for the suggestion. I appreciate it even though I've decided to keep the current recipe.
While he proposed recipe is really good at eliminating exhausted input sources, it is slower at its core task of yielding outputs (which is typically the important part).
The O(n) step in the current code runs at C speed and is really fast. On my six year old machine, running :cycle(islice(nexts, num_active))" for 1,000 nexts takes only 186ns.
One other thought: The existing recipe is also useful for showing off ways to use the itertools (which was really the principal purpose of having a recipes section). |
|
Date |
User |
Action |
Args |
2019-08-22 10:05:04 | rhettinger | set | recipients:
+ rhettinger, larry, cvrebert, docs@python, gdr@garethrees.org, david.lindquist |
2019-08-22 10:05:04 | rhettinger | set | messageid: <1566468304.71.0.322228797654.issue20727@roundup.psfhosted.org> |
2019-08-22 10:05:04 | rhettinger | link | issue20727 messages |
2019-08-22 10:05:04 | rhettinger | create | |
|