Is it possible to fasten the import of cgi?
Jorgen Grahn
grahn+nntp at snipabacken.dyndns.org
Mon Jan 22 09:55:29 EST 2007
On Thu, 18 Jan 2007 14:15:44 -0300, Gabriel Genellina <gagsl-py at yahoo.com.ar> wrote:
...
> I'll try to explain better: the cgi *protocol* (I'm not talking about the
> cgi *module*) requires a *new* python process to be created on *each*
> request. Try to measure the time it takes to launch Python, that is, the
> time from when you type `python ENTER` on your shell and the interpreter
> prompt appears.
On my Mac Mini with all of Python on local disk:
tuva:~> time python </dev/null
0.024u 0.012s 0:00.02 150.0% 0+0k 0+0io 0pf+0w
tuva:~> time python < /dev/null
0.028u 0.004s 0:00.02 100.0% 0+0k 0+0io 0pf+0w
tuva:~>
I.e. about 200--300ms. I assume startup time >> shutdown time.
If Python was at the other end of a NFS file system, much worse figures.
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org> R'lyeh wgah'nagl fhtagn!
More information about the Python-list
mailing list