This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients eric.snow, ncoghlan, scoder, vstinner
Date 2019-02-16.09:48:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550310489.5.0.93932202289.issue35949@roundup.psfhosted.org>
In-reply-to
Content
From Cython's point of view, the important fields in PyThreadState are the tracing/profiling and exception related ones. We're not using anything else. Users can explicitly opt out of the access to the exception fields by defining a C macro, at the expense of a bit of performance. I doubt that anyone is really doing that, though, because, why would they?

I'm not sure if we could avoid direct field access for profiling and tracing at all. You can look at the code, it's a whole bunch of macros that mimic what CPython does in ceval:

https://github.com/cython/cython/blob/master/Cython/Utility/Profile.c

I should note that both features are not enabled by default. Users have to explicitly enable profiling support via a directive, and even doubly opt in to tracing by enabling a compiler directive and a C macro. So production code will often not rely on these fields, but developers would want to use them and some might keep profiling support enabled also in their production code. My guess is that tracing is most often used for test coverage analysis.
History
Date User Action Args
2019-02-16 09:48:09scodersetrecipients: + scoder, ncoghlan, vstinner, eric.snow
2019-02-16 09:48:09scodersetmessageid: <1550310489.5.0.93932202289.issue35949@roundup.psfhosted.org>
2019-02-16 09:48:09scoderlinkissue35949 messages
2019-02-16 09:48:09scodercreate