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 methane
Recipients barry, cykerway, methane, ncoghlan, terry.reedy, vstinner
Date 2018-08-06.08:07:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533542867.92.0.56676864532.issue34296@psf.upfronthosting.co.za>
In-reply-to
Content
> i did 2 implementations in both python and pure bash, python takes about 500ms to run while bash is more than 10 times faster.

VM startup + `import site` are done in 10~20ms on common Linux machine.
It won't take 500ms.

While Python VM startup is not lightning fast, library import time is much slower than VM startup in many cases.  And since "importing library" may have many important side effects, we can't "pre warm" it.

Have you tried `PYTHONPROFILEIMPORTTIME=1` environment variable added by Python 3.7?
https://dev.to/methane/how-to-speed-up-python-application-startup-time-nkf
History
Date User Action Args
2018-08-06 08:07:48methanesetrecipients: + methane, barry, terry.reedy, ncoghlan, vstinner, cykerway
2018-08-06 08:07:47methanesetmessageid: <1533542867.92.0.56676864532.issue34296@psf.upfronthosting.co.za>
2018-08-06 08:07:47methanelinkissue34296 messages
2018-08-06 08:07:47methanecreate