python startup time 
Author Message
 python startup time

Quinn Dunkan asks:

> Why does the python take so long to start up?  Is it because it loads so many
> modules?  And if that is the case, why is module loading slow?  


There are 2 big factors. First is getpath.c, which attempts to
ascertain as completely as possible what the proper sys.path
is on your machine, and defends itself against sys admin-ish
tricks, developers running from strange places, damaged
OSes and other factors. It does a lot of hunting and pecking in
the process. If you're willing to live with some simple rules,
you can cut much of that out.

Imports can also be a problem. For each entry in sys.path,
Python will first try for c extensions, then pure Python
modules (which takes checking the .py against the .pyc /
.pyo). On both my NT box and my Linux box, I've put the
standard lib in a .pyz (an archive of compressed .pyc's) which
is much, much faster. This is all straight out of the installer
stuff on my starship pages (using Greg Stein's imputil module).

- Gordon

Thu, 05 Sep 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Startup time

2. CW2001.01 Application startup time

3. Can't translate PICK at startup time

4. Can't translate PICK at startup time

5. self-loading scripts (at Ruby's startup time)

6. Newbie Qs: startup time, Module.constants, chdir, Ruby distro's library

7. wish (unix) Interpreter Startup time

8. wish startup time (unix)

9. slow startup time with GCL

10. Tk 4.1a2 startup time under Windows

11. VisualWorks applications Startup times

12. a startup file for MSWLogo - startup.lgo (0/1)


Powered by phpBB® Forum Software