Commit 7c9f9b4
authored
Defer the psutil import until it is actually needed (#1551)
psutil is optional and its import is not cheap, yet it was paid for on
every kernel startup even though most sessions never ask for usage
information or need to enumerate child processes.
It is now imported through `_get_psutil()`, which caches the (possibly
None) result on first use.2 files changed
Lines changed: 26 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
71 | 86 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
| |||
1174 | 1185 | | |
1175 | 1186 | | |
1176 | 1187 | | |
| 1188 | + | |
1177 | 1189 | | |
1178 | 1190 | | |
1179 | 1191 | | |
| |||
1505 | 1517 | | |
1506 | 1518 | | |
1507 | 1519 | | |
| 1520 | + | |
1508 | 1521 | | |
1509 | 1522 | | |
1510 | 1523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
0 commit comments