Message339277
Here are some quick measurements on a single module¹ that uses typing. It shows about a 7% space savings between the baseline and patched versions:
-rw-r--r-- 1 raymond staff 3490 Mar 31 15:07 kmeans.cpython-38.opt-2.pyc
-rw-r--r-- 1 raymond staff 3245 Mar 31 15:10 kmeans.cpython-38.opt-2.pyc
Since unique types are singletons, the savings will likely be much less on bigger modules where the same types are used over and over again in the signatures:
>>> List[int] is List[int]
True
It would be nice if someone could measure the effect on a big project. It's possible that the benefits are negligible compared the savings from docstrings.
¹ https://raw.githubusercontent.com/rhettinger/modernpython/master/kmeans.py |
|
Date |
User |
Action |
Args |
2019-03-31 22:23:25 | rhettinger | set | recipients:
+ rhettinger, gvanrossum, levkivskyi, cary |
2019-03-31 22:23:25 | rhettinger | set | messageid: <1554071005.02.0.499663565975.issue36466@roundup.psfhosted.org> |
2019-03-31 22:23:25 | rhettinger | link | issue36466 messages |
2019-03-31 22:23:24 | rhettinger | create | |
|