Forum Moderators: coopster

Message Too Old, No Replies

Php includes and performance

         

asantos

6:03 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



Hi. I was wondering,
i have a config.php file which is called in every single page on my site.

that config.php has 5 php inclusions of some other php files that have some classes and functions.

some of the single pages use those classes and functions, but some dont.

the question is: does it make any difference to the single pages performance to include all the classes and functions even if they are not getting any use?

barns101

6:57 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



It will make a difference, as it is work for the PHP parser and the server itself. How much of a difference it will make depends on the size of the code. In practice it's probably not going to make any noticeable difference though.

mcibor

10:07 pm on Nov 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it's just declarations, etc, it won't make much difference, however if it's recursion or multiple loops through db or filesystem, then it does make a difference.

Regards
Michal