> <?php
>   require_once("Smarty.class.php");
>   require_once("DB.php");
> ?>

I used to think that require_once() was quite slow, and that doing your own:
if (!defined('smarty_class')){
define('smarty_class');
class Smarty{
    ...
}
}

was way more better.

It might depend on how *MANY* things you've already included...

So, you can paste that exact same code into your files, and it goes fast?
Don't Smary and DB do a lot of includes of their own?

And is DB using pconnect?  If not, *THAT* will be your biggest bottle-neck
of all.  Change that, and ab again.

Or, put it this way -- Move your pg_connect() into a connect.inc, and
require() that, and ab the joke page.

Your pg_connect() should be in a separate file not in your web-tree anyway.

> can process about 25 requests per second.
>
>   My applications use Smarty, Pear DB and my own classes from several
include
> files. Thus, they can hardly handle 10 requests per second. I tried to
> benchmark them in many different ways and I figured out that *including* a
> class takes a lot of time. Using those classes doesn't seem to change
> anything dramatically.
>   Is it an inherent problem of using classes with PHP or is there
something I
> can do about it?

Bottom line:  Loading in files from the disk on a busy server with multiple
users (IE, 200 different web-sites' index.htm files to clog up the cache)
can get very slow unless your file cache can hold them all.

Zend cache will ameliorate this to a great extent -- as the file is loaded
once into RAM and left there.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]

Reply via email to