[问题] 记录python script的效能使用

楼主: amigcamel (阿吉amig)   2014-01-10 12:24:47
想请问一下
有没有简单的方式可以记录
某一个python script或function在执行时
所消耗的cpu memory ...等等
已经查到一些可能跟这相关的东西有
top (linux command)
psutil (python module)
但是还是不太了解
有人愿意分享一下经验嘛?
我的用途主要是做效能回报
PS. OS为Ubuntu
作者: DemonDeath (Beethoven Virus)   2014-01-10 15:20:00
简单的python tool有line_profiler跟memory_profiler
楼主: amigcamel (阿吉amig)   2014-01-10 15:58:00
line_profiler 可以profile CPU usage 吗?
作者: Wush978 (拒看低质媒体)   2014-01-11 00:09:00
OS中直接用system call 查/proc/<pid>/status来看状态

Links booklink

Contact Us: admin [ a t ] ucptt.com