NYCPHP Meetup

[nycphp-talk] Performance hit from including classes

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


--- Mark Armendariz <nyphp at enobrev.com> 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):

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

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

H


>  
> Thank You
>  
> Mark Armendariz
> 
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 




More information about the talk mailing list