Skip to main content

ログ取得ツール (移転先予定地)

Pythonのプロファイラ

Pythonプログラムのプロファイルをとる方法。


 # python /usr/lib/python2.x/profile.py your-file.py

あるいは、対話型インタプリタから、


import profile
profile.run('your_function()')
profile.run('your_function()', "your_file")

詳しくはマニュアルを参照。hotshotというCで書かれたプロファイル用モジュールもあるらしい。こいつがprofileの後継となる模様。