STINNER Victor <vstin...@python.org> added the comment:
runpy startup time matters a lot for "python3 -m module" startup time! In Python 3.10 (bpo-41006 and bpo-41718), I reduced the number of modules imported by runpy: "The runpy module now imports fewer modules. The python3 -m module-name command startup time is 1.4x faster in average. On Linux, python3 -I -m module-name imports 69 modules on Python 3.9, whereas it only imports 51 modules (-18) on Python 3.10. (Contributed by Victor Stinner in bpo-41006 and bpo-41718.)" https://docs.python.org/dev/whatsnew/3.10.html#optimizations -- For argparse, maybe it could use a few lazy imports to reduce the number of indirect impots on "import argparse"? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45020> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com