[issue41756] Do not always use exceptions to return result from coroutine

Stefan Behnel report at bugs.python.org
Fri Sep 18 05:11:10 EDT 2020


Stefan Behnel <stefan_ml at behnel.de> added the comment:

BTW, just to give this a house number, I remember having measured a performance improvement of up to 70% at some point when switching from "generators always raise a StopIteration at the end" to "generators just return NULL" in Cython. For short-running generators and coroutines, this can make a big difference.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41756>
_______________________________________


More information about the Python-bugs-list mailing list