perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Chamas <>
Subject Re: [mp2] Making Apache::ASP optimized for mod_perl 2
Date Tue, 06 May 2003 15:03:37 GMT
Stas Bekman wrote:

> Another minor optimization would be to use:
> use constant MODPERL2 => ...; instead of $ModPerl2
> this will save a few if() run-time checks.

Thanks for the tip.  The $ModPerl2 in this case is calculated
at module load time, so I think the effect is the same, its just
not a constant.

> Bad programmer, no cookie ;)
> Seriously, please do not do that. Currently there are 38 Classes and 
> more will be added. You hardly need 10 or so classes. and if users want 
> some functionality in their code, they should be responsible for loading 
> it. Now if I use Apache::ASP you force the loading of all modules on me, 
> even if I don't want them and Apache::ASP doesn't use even half of them. 

I don't really use that much of the Apache API, just part of what is
exposed with the basic mod_perl 1 API.  So why then would I have to explicitly
load 9 separate modules?  I was really astonished when I had to load
Apache::Log for using log_error(), just as an example.

So how about some generic loader that loads a partial "CORE" set of
modules, especially to help with porting like Apache::Common or some such,
that just exposes what developers are used to programming with from mp1 days,
but without the full  &ModPerl::MethodLookup::preload_all_modules();

So an Apache::Common, might just be:

package Apache::Common;

use Apache::RequestRec ();
use Apache::RequestUtil ();
use Apache::RequestIO ();
use Apache::Response ();
use APR::Table ();
use APR::Pool ();
use Apache::Connection ();
use Apache::Server ();
use Apache::Log ();

# maybe some some others that those on the dev list would want to include?


> Yes, perl-5.8.0 w/ ithreads and w/o them have quite a big performance 
> differences as it was pointed out several times on the p5p list. I think 
> you should benchmark perl-5.8.0 w/o threads against mp1 and mp1/prefork 
> to make the benchmark fair.

That is a good point. Thanks.



Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.      
NodeWorks Link Checking      

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message