perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jen mlists" <>
Subject compiled mp2 handler?
Date Tue, 21 Aug 2007 07:08:43 GMT
I saw this document on site,

When a mod_perl hook is called for a given phase, the glue code has an
index into the array of handlers, so it knows to return DECLINED right
away if no handlers are configured, without entering the Perl runtime
as 1.0 did. The handlers are also now stored in an apr_array_header_t,
which is much lighter and faster than using a Perl AV, as 1.0 did. And
more importantly, keeps us out of the Perl runtime until we're sure we
need to be there.

Perl*Handlers are now "compiled", that is, the various forms of:

  PerlResponseHandler MyModule->handler
  # defaults to MyModule::handler or MyModule->handler
  PerlResponseHandler MyModule
  PerlResponseHandler $MyObject->handler
  PerlResponseHandler 'sub { print "foo\n"; return OK }'

are only parsed once, unlike 1.0 which parsed every time the handler
was used. There will also be an option to parse the handlers at
startup time. Note: this feature is currently not enabled with
threads, as each clone needs its own copy of Perl structures.


does this mean mp1 handler need to be parsed and compiled each time
when requests came and called that handler?
>From my understanding,mp1 handler should always be compiled only once
at apache startup time.Otherwise I don't think the handler has
performance advantage than common CGI.

Please help explain it.Thanks!

View raw message