履歴: プログラミング/python

各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 7 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます

日時タイトル文字数追加削除内容差分基準
2026/7/26 11:56:26プログラミング/python 最新版9,812+10 -6表示差分—
2026/7/4 10:04:43プログラミング/python 9,759+29 -2表示差分選択
2026/7/3 18:07:25プログラミング/python 8,832+36 -1表示差分選択
2026/1/16 13:11:29プログラミング/python 8,100+213 -1表示差分選択
2026/1/6 21:58:13プログラミング/python 1,818+30 -1表示表示中選択
2026/1/6 15:41:53プログラミング/python 1,263+45 -27表示差分基準
2026/1/6 13:24:56プログラミング/python 1,088— —表示—選択

基準: プログラミング/python (2026/1/6 15:41:53) → 比較: プログラミング/python (2026/1/6 21:58:13)

@@ -1,4 +1,4 @@
-#author("2026-01-06T06:41:53+00:00","default:administrator","administrator")
+#author("2026-01-06T12:58:13+00:00","default:administrator","administrator")
[[公開メモ]]
* プロファイリング [#t0ad56a0]
@@ -59,4 +59,33 @@
LANG:console
$ python do_profile.py
+
+** 解析する [#s2942399]
+
+ LANG:console
$ python -m pstats prof.out
+ Welcome to the profile statistics browser.
+ prof.out% strip # strip directory names
+ prof.out% sort cumtime # sort by cumtime
+ prof.out% stats 40 # show first 40 items
+
+これで、
+
+my_module.py:1234(my_function)
+
+みたいな関数ごとに
+
+ LANG:console
+ ncalls tottime percall cumtime percall filename:lineno(function)
+ 呼び出し 自前処理 呼び出し 子も含む 呼び出し ファイル名:行番号(関数名)
+ 回数 時間 あたり 全時間 あたり
+
+のリストが出ます
+
+特定の関数内から呼ばれている分だけを調べたければ、
+
+ LANG:console
+ prof.out% sort time
+ prof.out% callees my_module.py:1234(my_function)
+
+などとします。