> Is there any performance advantage (speed, memory consumption) to
> creating a single, large, mod_perl program that can handle various types
> of "requests" for database data (fetchUserData fetchPaymentData,
> fetchSubscriptionData).... as opposed to many small mod_perl scripts
> each related to a particular type of request? 

Keith, I think your question can be as easily changed to: "Should I use
many small scripts or just a few having all the code inside or in
modules?". 

There is almost no difference, since all the code is compiled once and
cached since than. The best technique is to write all your code using
modules and having only a few lines of code in the scripts. 

The only possible overhead with all-in-one approach is a need to pass the
control variables so the code with know what functions to call. But this
overhead is negligible. The only other thing is that you will have to
change the URLs to use these control variables. 

>From my experince, the maintance of big multi-functional applications is
much easier when you don't mess with scripts, but centralize all the code
in modules. It also make you write better code since you will have less
code duplications. Probably there are more benefits.

The only benefit of using many small scripts that I can see, is if there
are some scripts that are almost never get used. So with small scripts you
probably can save a few MBytes... 

Taken that there is no difference in time between loading a few big
modules and a single small script (they all are cached), this question
scales up to the general question of sw design which others will probably
answer better than me :) 

_______________________________________________________________________
Stas Bekman    mailto:[EMAIL PROTECTED]      http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC     http://www.stason.org/stas/TULARC
perl.apache.org    modperl.sourcegarden.org   perlmonth.com    perl.org
single o-> + single o-+ = singlesheaven    http://www.singlesheaven.com

Reply via email to