I’m new to PHP and trying to make my website as fast as possible.
Is there any real difference in speed between including, say, an 9K file rather than a 60k file?
I’m precalculating database queries and wondering if I should save the results of each query in a separate file or whether they would be ok all in the same file.
Just to add to what krt said there is some overhead when doing includes opposed to having the code already there. Now is the overhead noticable? No not in most people’s cases. You’ll start to notice it when you’re including 50 files on one page.
No, the script is not downloading the pages, it is being done on the server and accessing files on the local filesystem is quick enough that the difference in cases like your one will be negligible.
As for what you are trying to do, I would suggest separate files to save processing when parsing through the larger file to get the data needed.