Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a warning when time is likely spent in another thread #71

Open
joerick opened this issue Sep 9, 2019 · 1 comment
Open

Provide a warning when time is likely spent in another thread #71

joerick opened this issue Sep 9, 2019 · 1 comment

Comments

@joerick
Copy link
Owner

joerick commented Sep 9, 2019

pyinstrument only records one thread at a time. However, due to the GIL, the performance of one thread could be affected by a different active thread in the same program.

Python can now give CPU time per-thread:

This could be compared with the program CPU time - if the current thread is less than 80% of the program's CPU time, it's likely that that other thread was slowing the profiled one down - this should be communicated in pyinstrument's output.

It would be even better if we could track the time spent inside the GIL (and even subtract it), but I'm not sure how to do that!

@milesgranger
Copy link

Was here looking for something else, but came across this and FWIW a project I did a while ago might help? gilknocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants