jesse is right. I can only add that I had a shopping cart that loaded thousands of lines of code, one file which had over 7,000 lines in it and the site didn't take any time to load.
What I have done with loading issues is sometimes done an echo spot check, so to speak.
I would create a timestamp like:
$start = date("U");
then every few lines after some major code has been executed or something I would add:
Echo "time to load:" . (date("U") - $start);
this would output to the browser and you can search for the strings to see where the delay is happening.
Main Topics
Browse All Topics





by: jessegivyPosted on 2009-05-26 at 10:06:49ID: 24475206
As much as I hate to say this loading the file really shouldn't be an issue. I'd like to suggest first of all that you look into object oriented programming as an overall solution to your procedural woes.
What I can recommend as far as optimization of the existing code is to simply do some performance testing, hopefully by unit testing your massive include file, but perhaps simply identifying where the lag is occurring by commenting out functionality could work. Have you come to the conclusion that the lag is simply incurred by including the large file by trying to just load the page without including it?
Regards,
Jesse