[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

Stefan Behnel report at bugs.python.org
Sat Apr 14 11:16:13 CEST 2012


Stefan Behnel <scoder at users.sourceforge.net> added the comment:

>> As long as there is a way to access these fields directly from the
>> struct (with the usual preprocessor conditional), I don't think Cython
>> will actually start to use the PyErr_[GS]etExcInfo() functions in
>> CPython - simply for performance reasons.
>
> Isn't this premature optimization? Do you have any workload where you
> measured a performance degradation?

To be honest - I don't know if it makes a measurable difference. However, the code is there, it's required for all currently released CPython versions (i.e. those still being supported for years to come), and it is used in seriously performance critical places, such as each generator/coroutine iteration - twice. Why should we add overhead to those without need?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13897>
_______________________________________


More information about the Python-bugs-list mailing list