perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Chamas <j...@chamas.com>
Subject Re: [mp2] Making Apache::ASP optimized for mod_perl 2
Date Wed, 07 May 2003 01:14:13 GMT
Stas Bekman wrote:
>>
>> 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.
> 
> 
> The effect is very different, that's the whole point of using constants. 
> By using a constant the parser will optimize the code and throw away the 
> branches that won't be executed.
> 

I have done benchmarks of constants vs. scalars, and have not seen much
of a difference before ... I hesitate to start using constants in CPAN
modules as I do not know how far back they go with older perls
( do they work for perl 5.005 ?? ), perl 5.005 would be the earliest perl
I would support at this point if someone asked me to do so.  I gave up
on perl 5.004_04 a year to 2 back, so I am clearly slow to upgrade :)

> 
> I believe, very quickly this common thing will grow, as different people 
> have different needs and it's going to be hard to find a golden middle. 
> For example if I don't use HTTP handlers, but use mp2 to write protocol 
> modules, my common list wouldn't include any of the Apache::Request* 
> modules.
> 

How about then an Apache::CommonMP1, or some such just to ease the
compatibility thing, without the full Apache::compat, or rather an
Apache::compat_lite ???  The very big difference being that Apache::compat
is strong advised to not have CPAN authors use, but an Apache::CommonMP1
might not have such an advisory.  The name doesn't matter, but the effect
does, that module authors have a nice module to load that gets them most
of the functions that they have grown accustomed to over the years.

> Very quickly you will find all the modules that Apache::ASP needs to 
> load and you will move on to deal with other problems. It's not like you 
> say *argh* every few minutes for the next few years to come, because 
> every time some module wasn't loaded.
> 

Right, I do not make these suggestions for myself, but for those who
will do the same as I have done, that is port larger modules
to mp2.  That was the only point of my sharing, as I have already
solved the problem as you say.  I just picture the next thousand
people saying *argh* and thinking there might be an improvement.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message