On Wed, 11 Jul 2001, Philip Mak wrote:

> In the recent Hello World 2000 benchmark posted by Joshua Chamas, mod_perl
> handler was shown to be even faster than static HTML (at least for running
> hello world), and twice as fast as using Apache::Registry to run a perl
> script.

I honestly think something is up there. The code that mod_perl goes
through before executing the actual perl script is a lot slower than the
code the static HTML (http_core) handler goes through.

FWIW, In AxKit 1.4_80 on axkit.org (beta, has bugs), I've implemented
something I call a mod_perl fast handler, which skips most of the stuff in
mod_perl, allowing you to go: "AddHandler axkit .xml" in your httpd.conf,
and it works much the same way as SetHandler/PerlHandler does, except
faster. Obviously though you lose the benefit of being able to write
handlers for the different handler phases with this method. And it
requires XS code.

> Does this mean that if there's a heavily used script on my system that
> needs to be VERY fast, then it may be worth making it into a mod_perl
> handler? What are the caveats of using mod_perl handlers instead of normal
> scripts?

Using handlers is better. Hands down. :-)

Personally I just find handlers more logical than CGI scripts. They have a
known entry point, which I think makes life a hell of a lot easier in
structuring complex code. Rather than the entry point being "the top of
your script".

There's a beginners article on take23 about writing your first handler
module.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\

Reply via email to