> > Having all the function bodies in the same file would cause php to have
> > to parse all
> > of that code, probably about 3-4000 lines causing awful slowdowns. And
> > the reason to define all of
> > the functions in one file, is so that we can include that file, and all
> > the functions are then available.
>
> hmm, depending on the function size I would say the parser is much faster
> doing that than the HDD drive reading each file from the disk and ending
> in lesser php code to parse.
Indeed. One thing I forgot to mention, is that IIRC most OS's will cache
commnly used files, so if you use this method on a busy site, it may make
fewer calls to disk than anticipated.
As always, YMMV, and benchmarking will show the true path to follow. If you
really want to improve performance, mainly on time consuming or DB intensive
scripts, you may be interested in the output cache app on my website.
> OTOH, it is not possible to do your way w/ class methods :((
Sure is, though admittedly it's not as "nice":
class my_class{
var $a;
var $b;
function my_class(){
return include('functions/class.my_class.func.my_class.inc');
}
function my_func(){
return include('functions/class.my_class.func.my_func.inc');
}
}
> I guess the ammoun of include/one-shot-code depends on the application,
> programming style, but somewhere they should balance.
For sure.
--
Richard Heyes
http://www.heyes-computing.net
"Everything should be made as simple as possible, but not simpler." - Albert
Einstein
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]