[Python-Dev] Python startup time
Cesare Di Mauro
cesare.di.mauro at gmail.com
Thu Jul 20 13:09:38 EDT 2017
More information about the Python-Dev mailing list
Thu Jul 20 13:09:38 EDT 2017
- Previous message (by thread): [Python-Dev] Python startup time
- Next message (by thread): [Python-Dev] Python startup time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
2017-07-19 16:26 GMT+02:00 Victor Stinner <victor.stinner at gmail.com>: > 2017-07-19 15:22 GMT+02:00 Oleg Broytman <phd at phdru.name>: > > On Wed, Jul 19, 2017 at 02:59:52PM +0200, Victor Stinner < > victor.stinner at gmail.com> wrote: > >> "Python is very slow to start on Windows 7" > >> https://stackoverflow.com/questions/29997274/python-is- > very-slow-to-start-on-windows-7 > > > > However hard you are going to optimize Python you cannot fix those > > "defenders", "guards" and "protectors". :-) This particular link can be > > excluded from consideration. > > Sorry, I didn't read carefully each link I posted. Even for me knowing > what Python does at startup, it's hard to explain why 3 people have > different timing: 15 ms, 75 ms and 300 ms for example. In my > experience, the following things impact Python startup: > > * -S option: loading or not the site module > * Paths in sys.path: PYTHONPATH environment variable for example > * .pth files files in sys.path > * Python running in a virtual environment or not > * Operating system: Python loads different modules at startup > depending on the OS. Naoki INADA just removed _osx_support from being > imported in the site module on macOS for example. > > My list is likely incomplete. > > In the performance benchmark suite, a controlled virtual environment > is created to have a known set of modules. FYI running Python is a > virtual environment is slower than "system" python which runs outside > a virtual environment... > > Victor > > Hi Victor, I assume that Python loads compiled (.pyc and/or .pyo) from the stdlib. That's something that also influences the startup time (compiling source vs loading pre-compiled modules). Bests, Cesare <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Mail priva di virus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20170720/b2be42b1/attachment.html>
- Previous message (by thread): [Python-Dev] Python startup time
- Next message (by thread): [Python-Dev] Python startup time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list