Author rhettinger
Recipients cvrebert, david.lindquist, docs@python, gdr@garethrees.org, larry, rhettinger
Date 2019-08-22.10:05:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566468304.71.0.322228797654.issue20727@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2019-08-22 10:05:04rhettingersetrecipients: + rhettinger, larry, cvrebert, docs@python, gdr@garethrees.org, david.lindquist
2019-08-22 10:05:04rhettingersetmessageid: <1566468304.71.0.322228797654.issue20727@roundup.psfhosted.org>
2019-08-22 10:05:04rhettingerlinkissue20727 messages
2019-08-22 10:05:04rhettingercreate