Commit c42e9d7
committed
Resolve SocketHandler's imports at construction, not eagerly
pickle, socket and struct go back to lazy. emit() can run during
finalization, when importing no longer works, so SocketHandler.__init__
resolves them while it still can. Keeping them eager instead gives back
three quarters of the handlers.py import-time win.1 parent bafee5d commit c42e9d7
3 files changed
Lines changed: 22 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
517 | | - | |
| 516 | + | |
518 | 517 | | |
519 | 518 | | |
520 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| 613 | + | |
| 614 | + | |
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1866 | 1866 | | |
1867 | 1867 | | |
1868 | 1868 | | |
1869 | | - | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
| 1869 | + | |
| 1870 | + | |
1873 | 1871 | | |
1874 | 1872 | | |
1875 | 1873 | | |
| |||
7619 | 7617 | | |
7620 | 7618 | | |
7621 | 7619 | | |
7622 | | - | |
7623 | | - | |
| 7620 | + | |
| 7621 | + | |
7624 | 7622 | | |
7625 | 7623 | | |
| 7624 | + | |
| 7625 | + | |
| 7626 | + | |
| 7627 | + | |
| 7628 | + | |
| 7629 | + | |
| 7630 | + | |
| 7631 | + | |
| 7632 | + | |
| 7633 | + | |
| 7634 | + | |
| 7635 | + | |
7626 | 7636 | | |
7627 | 7637 | | |
7628 | 7638 | | |
| |||
0 commit comments