This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients BTaskaya, Mark.Shannon, brandtbucher, brett.cannon, eric.snow, gvanrossum, indygreg, larry, lemburg, methane, miss-islington, nascheme, ncoghlan, rhettinger, ronaldoussoren, shihai1991, terry.reedy, vstinner
Date 2021-09-19.10:39:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632047986.66.0.432881476471.issue45020@roundup.psfhosted.org>
In-reply-to
Content
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"?
History
Date User Action Args
2021-09-19 10:39:46vstinnersetrecipients: + vstinner, lemburg, gvanrossum, brett.cannon, nascheme, rhettinger, terry.reedy, ronaldoussoren, ncoghlan, larry, methane, Mark.Shannon, eric.snow, indygreg, miss-islington, brandtbucher, BTaskaya, shihai1991
2021-09-19 10:39:46vstinnersetmessageid: <1632047986.66.0.432881476471.issue45020@roundup.psfhosted.org>
2021-09-19 10:39:46vstinnerlinkissue45020 messages
2021-09-19 10:39:46vstinnercreate