DAGDA SEARCH | Back to results | Support

Speed Up Interpreter Startup - Python Wiki

Source: https://wiki.python.org/python/performance/SpeedUpInterpreterStartup.html

  1. Python Wiki /
  2. Python Wiki /
  3. Performance /
  4. Speed Up Interpreter Startup
View as Markdown

Speed Up Interpreter Startup

Legacy Wiki Page

This page was migrated from the old MoinMoin-based wiki. Information may be outdated or no longer applicable. For current documentation, see python.org.

At PyCon 2004 the startup time of the interpreter was analyzed and it was realized that no simple solution existed. Part of the reason was some older code, such as the ‘site’ module which could stand a rewrite, was not optimized for modern Python. Another issue was other modules that were written in Python that might do better written in C (‘warnings’?). It seemed importation of code was the major cause of a slow startup.

So, to make this work, one might need to consider:

Notes

The thing I keep running into is the time it takes the ‘re’ module to load. Python doesn’t load that initially by default but it’s widely used so its slowness does in practice slow down startup. - Stephan Deibel

PreviousSpeed Up 2to 3 Pattern Matching Next Platform-Specific