Commit be51e9c
authored
Add proper lazy deserialization (python#21198)
On Linux with Python 3.12 this gives (compared to 1.20.0):
* almost 2x less memory overhead per parallel worker
* 3-4% faster cold parallel runs
* (most notably) ~2x faster `mypy -c 'import torch'` with warm cache, on
my desktop warm torch now takes 250-300ms1 parent c6d938e commit be51e9c
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4767 | 4767 | | |
4768 | 4768 | | |
4769 | 4769 | | |
| 4770 | + | |
| 4771 | + | |
4770 | 4772 | | |
4771 | 4773 | | |
4772 | 4774 | | |
| |||
4790 | 4792 | | |
4791 | 4793 | | |
4792 | 4794 | | |
| 4795 | + | |
| 4796 | + | |
4793 | 4797 | | |
4794 | 4798 | | |
4795 | 4799 | | |
| |||
4824 | 4828 | | |
4825 | 4829 | | |
4826 | 4830 | | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
4827 | 4834 | | |
4828 | 4835 | | |
4829 | 4836 | | |
| |||
4958 | 4965 | | |
4959 | 4966 | | |
4960 | 4967 | | |
4961 | | - | |
4962 | | - | |
4963 | | - | |
4964 | | - | |
4965 | | - | |
| 4968 | + | |
| 4969 | + | |
4966 | 4970 | | |
4967 | 4971 | | |
4968 | 4972 | | |
| |||
0 commit comments