如何在Python中分析多线程程序? [英] How can I profile a multithread program in Python?

查看:76
本文介绍了如何在Python中分析多线程程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Python开发一个固有的多线程模块,我想找出它在哪里花时间. cProfile似乎仅分析主线程.有什么方法可以分析计算中涉及的所有线程?

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 there any way of profiling all threads involved in the calculation?

推荐答案

请参阅 yappi (还有另一个Python Profiler).

Please see yappi (Yet Another Python Profiler).

这篇关于如何在Python中分析多线程程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆