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.

classification
Title: Document that cprofile/profile only profile the main thread
Type: enhancement Stage:
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: benspiller, docs@python
Priority: normal Keywords:

Created on 2019-10-27 18:18 by benspiller, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg355492 - (view) Author: Ben Spiller (benspiller) * Date: 2019-10-27 18:18
The built-in profiling modules only provide information about the main thread (at least when invoked as documented). 

To avoid user confusion we should state this in the documentation at https://docs.python.org/3/library/profile.html. 

Potentially we could also suggest mitigations such as manually creating a Profile instance in the user's thread code, but the most important thing is to make clear what the module does/does not do out of the box. 

(see also https://bugs.python.org/issue9609 which discusses a possible non-doc change to help with multi-threading, but looks like that's stalled, so best to push ahead with doc'ng this.
History
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82788
2019-10-27 18:18:43benspillercreate