Page 1 of 1

Php file size

Posted: Fri Sep 19, 2008 4:50 pm
by bennyChidge
Just a quick design question.

At what point should you become worried about the file size of your .php file?

Obviously everything small works quicker on the web and i have a site with all the usual load, css, js, images, flash, and php all adding up for one page load.

I am running a file thats starting to get quite big in my eyes (40k+) and im starting to think what is "best practice" for .php file size? hmmm actually does it matter as its just the html thats rendered and downloaded?

I come from a mobile background and do like everything to be as small as it can be - but am I worrying to much?

Ta

Re: Php file size

Posted: Fri Sep 19, 2008 5:09 pm
by josh
The contents of the PHP code are never sent to the user, the biggest performance on the filesystem is when the hard drive has to do a lot of seeking ( ie. many # of smaller files being included ). Hard drives are better at moving one large file then many small files that equal the same size.

However, often the need to break the code down into smaller manageable parts outweighs performance issues, seeing as a 40KB file may have been a lot of code 30yrs ago but this is 2008 now :D

Granted there is definitely a reason to optimize the contents that is being sent to the client / user... but on the server side if your servers choking over 40kb it may be time to upgrade

Re: Php file size

Posted: Fri Sep 19, 2008 5:30 pm
by bennyChidge
Cheers

No choking here just wondering if theres a point when someone says bloomin heck mate your php file is a bit big!

Re: Php file size

Posted: Fri Sep 19, 2008 5:34 pm
by Christopher
When it causes an actual performance or maintenance problem.