The idea of having a pre-processor to build an UBER-class worries me.
loads like Nathan describes is am much better solution.
If the bottleneck is filesystem IO the best way to speed this up if you have
over the box (IMHO), would be to make a RAM disk and mount it where
php/apache can see it then
cache the classes onto it when apache starts.
This would make the IO time portion of include real fast.
http://www.genolog.com is my 0.5 phpslash site, With many code changes from the
base migration doesn't look to
easy but sometime in the next few weeks it is going over to 'Greasy Spoon'.
From: nathan r. hruby [mailto:nhruby@...]
Sent: Tuesday, March 27, 2001 11:28 AM
To: Ajay Sharma
Cc: PHPslash list
Subject: Re: [phpslash-users] number of includes..
On Tue, 27 Mar 2001, Ajay Sharma wrote:
> I was just reading on phpbuilder.com about how to increase the
> performance of a website and there was one comment that we had talked
> about a long time ago.
> Someone asked Rasmus what's the worst bottleneck and he said that
> including files is the worst thing you can do because the webserver has
> to hit the filesystem for EACH include and stat the file, etc... But
> everyone needs to use include() so there's usually not much you can do
> about it. Then came along objects and several class files which means
> tons of includes. Afer I read this comment, I thought PHPSlash might
> get a big speed boost if we were to put all the .class files in ONE
> massive file called AllClasses.php and just do one FAT include. That
> way the webserver doesn't have to hit the filesystem a dozen times
> trying to read all the .class files.
Er.. That's what Cache engines are for. Zend, phpCommunity Cache
(er.. whatever its called), etc...and the PEAR/Cache classes ae designed
to do exactly that. I'd rather optimize / implement for these than
messing with the include() system, which as it stands right now, makes it
*much* easier to pull bug fixes from CVS and generally makes life happy
for others. This also makes it harder for people to figure out and
probably would reduce bug reports / patches.
One thing I want to do, for this reason asn the reason of memory overhead
is implement a $page_needs array on each .php page in phpslash so that
only the classes needed for a page are included() (A bit-o-logic would do
the required includes in config.php3).
nathan hruby - nhruby@...
computer support specialist
department of drama and theatre
phpslash-users mailing list