Support multithreaded profiling
Author: georgeharkerCreated Dec 4, 2024Updated Mar 15, 2025
Thanks for pyintrument - it's incredibly useful
I had need to trace a multithreaded python app and examine the relationship between threads. Obviously in some cases multithreading can be a little interesting in python, but in this particular case works well.
I have extended a fork of pyinstrument to support showing all child threads from the one where profiling starts. I get nice results with all threads separated which has been hugely helpful.
I'll file a PR and reference this issue. It's still a bit of a WIP, but i'd be curious to see if it looks reasonable to you.
Source: joerick/pyinstrument