Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to Fix CGI

by tirwhan (Abbot)
on Nov 07, 2007 at 15:11 UTC ( [id://649497]=note: print w/replies, xml ) Need Help??


in reply to How to Fix CGI

Hmm, I'm doubtful. AFAICS the assumption he makes is that simply having a persistent perl interpreter in memory, which loads scripts and modules at runtime, will save a lot of time and processing power. I don't think that assumption is correct. Try this in your shell:

sh-3.1$ time perl -e '' real 0m0.005s user 0m0.000s sys 0m0.000s sh-3.1$ time perl -MCGI::Simple -e '' real 0m0.026s user 0m0.020s sys 0m0.000s

Loading the perl interpreter, compiling and executing the noop takes 0.005 seconds, whereas doing the same and loading the CGI::Simple module takes more than five times as long (you can try this with CGI as well, but that's a little unkind ;-). His proposition would only manage to save a small part of the 0.005 seconds, namely the time it takes the OS to fork and start a new process and load the perl interpreter into memory. So I may have some flaw in my thinking here (in which case I'd be thankful if someone more knowledgeable than me could point it out), but I just don't see the point of his mod_perllite.

Caveat: above is on Linux, things may be very much different on fork-challenged platforms ;-).


All dogma is stupid.

Replies are listed 'Best First'.
Re^2: How to Fix CGI
by Anonymous Monk on Nov 07, 2007 at 19:26 UTC
    The key problems we want to work around are user and web host aversion to CGI and intense complexity and persistence of mod_perl. Imagine if this is all you needed to add to Apache before you could throw any file with a .pl extension into your web root and that's it, you're off and running Perl: LoadModule perlite_module modules/mod_perlite.so AddType application/x-httpd-perlite .pl AddDirectoryIndex index.pl This we can sell shared hosting providers on. mod_perl we unfortunately cannot.
      Post above by moi, Aaron Stone, btw. The royal 'we' referring to 6A ;-)
      Apparently I didn't RTFM about how to comment with code...
      LoadModule perlite_module modules/mod_perlite.so AddType application/x-httpd-perlite .pl AddDirectoryIndex index.pl
      My goal is to make this project 80% good at the 80% problem, and nothing more.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://649497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found