geez.  i don't recall "Apache::Registry vs. pure PerlHandler" or
"Apache::Request vs. CGI.pm" ever being so harsh.

but they have been compared, for good reason.

Apache::Registry maps a request to a file and generates a subroutine to
run the code contained in that file.  if you use a 'PerlHandler
My::handler' instead of Apache::Registry, you have a direct mapping from
request to subroutine, without the steps inbetween.  these steps include:

stat the $r->filename
check that it exists and is executable
generate a Perl package name based on $r->uri
chdir basename $r->filename
compare last modified time
if modified or not compiled, compile the subroutine
chdir $old_cwd

if you cut out those steps, you cut out some overhead, plain and simple.
do you NEED to cut out that overhead?  i don't know, your requirements
determine that.

as for CGI.pm vs. Apache::Request.
last i checked 'use CGI qw(-compile => ':all') adds 1Mb size to the
server.  CGI.pm pulls lots of stunts under the covers to provide both a
method and function interface, etc.  Apache::Request is a very thin xs
layer on top of a C library and only adds a few k size to the server.
this C code is much faster and lighter than the Perl equivalent used in
CGI.pm or similar (e.g. CGI_Lite).  again, this difference might not
matter much to you, depending on your requirements.

Reply via email to