How can I profile a multithread program in Python?

前端 未结 7 632
囚心锁ツ
囚心锁ツ 2020-11-30 04:12

I\'m developing an inherently multithreaded module in Python, and I\'d like to find out where it\'s spending its time. cProfile only seems to profile the main thread. Is the

7条回答
  •  悲哀的现实
    2020-11-30 04:54

    I don't know any profiling-application that supports such thing for python - but You could write a Trace-class that writes log-files where you put in the information of when an operation is started and when it ended and how much time it consumed.

    It's a simple and quick solution for your problem.

提交回复
热议问题