履歴: プログラミング/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)
+
+などとします。