Basic import Questions (with bonus profiling question)
- From: "Gregory Piñero" <gregpinero@xxxxxxxxx>
- Date: Thu, 31 Aug 2006 11:49:27 -0400
Hey Folks,
Some import questions that a search didn't turn up for me.
1. Will "from somemodule import onething" take as long to start up as
import somemodule?
2. Is there anyway I can get at onething more quickly?
3. If I put an import statement hidden away in some function, will
Python only do the import when that function is called? If I say,
never use that function would that import statement affect performance
at all?
Ultimately I have IIS running python as a CGI script and it seems to
just be taking many seconds to load a small page. I'm guessing the
issue is starting up the interpreter and loading all the modules.
BTW I know it would be better to profile the code but how do you
profile a CGI script? I can't just pass it CGI parameters can I? And
does profiling take into account the time of loading modules?
Thanks,
-Greg Pinero
.
- Prev by Date: HTTPS Login
- Next by Date: Re: sys.argv[0] doesn't always contain the full path of running script.
- Previous by thread: HTTPS Login
- Next by thread: Re: Basic import Questions (with bonus profiling question)
- Index(es):