Message349546
> This will remove awkward maneuvers like ast.c importing unicodedata in order to perform normalization.
unicodedata is not needed by default. ast.c only imports unicodedata at the first non-ASCII identifier. If you application (and all dependencies) only use ASCII identifiers, unicodedata is never loaded. Loading it dynamically reduces the memory footprint.
Raw measure on my Fedora 30 laptop:
$ python3
Python 3.7.4 (default, Jul 9 2019, 16:32:37)
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS: 10236 kB
>>> import unicodedata
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS: 10396 kB
It uses 160 KiB of memory. |
|
Date |
User |
Action |
Args |
2019-08-13 12:23:29 | vstinner | set | recipients:
+ vstinner, benjamin.peterson, mcepl, ezio.melotti, serhiy.storchaka, Greg Price |
2019-08-13 12:23:29 | vstinner | set | messageid: <1565699009.76.0.879436140962.issue32771@roundup.psfhosted.org> |
2019-08-13 12:23:29 | vstinner | link | issue32771 messages |
2019-08-13 12:23:29 | vstinner | create | |
|