STINNER Victor <[email protected]> added the comment:
> 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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32771>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com