Performance
Posted: Fri Jul 29, 2011 12:18 pm
My browser game is progressing steadily, mainly thanks a lot of information I got from these forums=)
I have a question about performance, which is;
Does the INCLUDE command have a big impact on performance?
While I was working on my game, at one point I wanted to have a bit more structure in my php files. So for readabilty I created a bunch of seperate PHP files (mainly code being used in multiple places, or standalone functionality) and also create some subfolders to put them in.
So now my main PHPs have a lot of INCLUDEs.
First I left all the new created INCLUDE PHPs in the same root dir, and when testing it didnt seem to have a big impact on performance. But on 1 pc its kinda hard to stress-test it.
When I placed the PHP's in seperate subfolders (for example a combat folder, a statinfo folder, etc. etc. Each with a few PHP's on that subject), performance did seem to take a hit.
I used the following notation to direct to the PHP's.
For INCLUDES called from a PHP in the root dir I did:
include 'hero/heroraceclassinfo.php';
FOR INCLUDES called from a PHP in a subfolder I did:
include '../hero/heroinfo.php';
Now Im wondering if I should change it back to all PHP's just in the root folder. Or maybe somebody can enlighten me a little on the use of Includes?
Thanks in advance=)
I have a question about performance, which is;
Does the INCLUDE command have a big impact on performance?
While I was working on my game, at one point I wanted to have a bit more structure in my php files. So for readabilty I created a bunch of seperate PHP files (mainly code being used in multiple places, or standalone functionality) and also create some subfolders to put them in.
So now my main PHPs have a lot of INCLUDEs.
First I left all the new created INCLUDE PHPs in the same root dir, and when testing it didnt seem to have a big impact on performance. But on 1 pc its kinda hard to stress-test it.
When I placed the PHP's in seperate subfolders (for example a combat folder, a statinfo folder, etc. etc. Each with a few PHP's on that subject), performance did seem to take a hit.
I used the following notation to direct to the PHP's.
For INCLUDES called from a PHP in the root dir I did:
include 'hero/heroraceclassinfo.php';
FOR INCLUDES called from a PHP in a subfolder I did:
include '../hero/heroinfo.php';
Now Im wondering if I should change it back to all PHP's just in the root folder. Or maybe somebody can enlighten me a little on the use of Includes?
Thanks in advance=)