You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Jen mlists <pr...@gmail.com> on 2007/08/21 09:08:43 UTC

compiled mp2 handler?

I saw this document on perl.apache.com 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!

Re: compiled mp2 handler?

Posted by Perrin Harkins <pe...@elem.com>.
On 8/21/07, Jen mlists <pr...@gmail.com> wrote:
> does this mean mp1 handler need to be parsed and compiled each time
> when requests came and called that handler?

No, it means that the dispatch code like "MyModule->handler" is parsed
and compiled each time.

- Perrin