like mod_python but in the kernel????

C

Camilo Olarte

Hi list,

I was wondering :

If python cgi scripts can be acceletaded by means of mod_python in apache
(loading the python interpreter on apache) , then : ?Is there a way of doing
the same but with linux kernel... and command line scripts ?

I mean can python interpreter be loaded as module of the kernel and thus making
execution of python scripts faster ???

Is there something perverse in this way of thinking????

I know that pypy is on the way , probably making python execution faster.

Just daydreaming of this python kernel module stuff.


NOTE: I have no problem with actual python speed. It's just that mod_python
stuff calls my attention because it icrements the speed of execution of a cgi
script from 4 Requests/second to aprox 140 Requests/second.


Camilo Olarte






Telesat, más fácil...más Internet.
http://www.telesat.com.co/
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Camilo said:
If python cgi scripts can be acceletaded by means of mod_python in apache
(loading the python interpreter on apache) , then : ?Is there a way of doing
the same but with linux kernel... and command line scripts ?

No. mod_python reduces startup speed because it performs all the import
actions that occur when Python starts. The same is not possible with the
command line, as memory that the kernel allocates is not accessible to
applications.
I mean can python interpreter be loaded as module of the kernel and thus making
execution of python scripts faster ???

No !!! Instead, to reduce startup time, you need to first find out why
startup is slow. There are many theories; mine is that usage of shared
libraries for extension module increases startup time.
Is there something perverse in this way of thinking????

No!!!! Just in your usage of punctuation :)

Regards,
Martin
 
J

JanC

Martin v. Löwis said:
No. mod_python reduces startup speed because it performs all the
import actions that occur when Python starts. The same is not possible
with the command line, as memory that the kernel allocates is not
accessible to applications.

Then embed Python in the shell instead of in the kernel... ;-)
 
?

=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=

JanC said:
Then embed Python in the shell instead of in the kernel... ;-)

That would work. Alternatively, you could make /usr/bin/python
your login shell, in the first place.

Regards,
Martin
 
D

David M. Wilson

Camilo Olarte said:
I mean can python interpreter be loaded as module of the kernel and thus
making execution of python scripts faster ???
I know that pypy is on the way , probably making python execution faster.

That's an interesting conclusion. :)

Just daydreaming of this python kernel module stuff.

There is probably a lot of things you can check before assuming you
need some sort of acceleration, eg. the basics: are all the packages &
modules your application uses compiled? Are the pycs up to date?
Google for compileall.py.

Is the (your) application doing an insane amount of work at startup,
like reading a massive XML configuration file? Perhaps you could speed
that up by caching the loaded configuration as Python syntax in a new
file, or some other means that would make loading faster.

Etc.


David.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top