Commit 6722272
committed
Defer
`urlencode` has one caller, `%pastebin`, in the same function that
already defers `urllib.request`. Importing it at module level cost 2.5 ms
on every startup (6.7 ms and 30 modules in a cold interpreter, since
`urllib.parse` pulls `ipaddress`).
In a clean interpreter `import IPython.terminal.ipapp` goes from 485 to
482 modules; `urllib.parse` and `ipaddress` no longer appear at startup.urllib.parse in core/magics/code.py
1 parent 4015f9d commit 6722272
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
0 commit comments