[nycphp-talk] Performance hit from including classes

Hans Zaunere zaunere at
Tue Apr 1 09:35:05 EST 2003

--- Mark Armendariz <nyphp at> wrote:
> Up until now, I've been only including (via require_once) only the
> classes I need within the script that's executing.  My upload class for
> file processors, database class for mysql, my dropdown class for
> selects, etc, etc.  I suppose it would be much cleaner and more
> manageable if I included them all in my application_top.php or
> configure.php file.
> Does anyone know how much of a performance hit it would be to include
> all 6 or 8 classes at once?

It really depends on how much traffic you're dealing with.  If it's mild
traffic, I doubt you'd see any difference - obviously more traffic would have
a greater impact.

If I remember correctly, here are some details on the include/require family
(please correct me if I've made a mistake):

   -- compile time (using a cache will make the overhead very small)
   -- require_once() has more overhead than require()

   -- runtime directives (more expensive than any of the require()s)
   -- include_once() has more overhead than include()


> Thank You
> Mark Armendariz
> --- Unsubscribe at ---

More information about the talk mailing list