Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I am not an expert on anything, but I will say that you probably won't run into problems until your file size is a significant proportion of your PHP Memory Limit.</p> <p>And I will tell you, I've got a mess of code in one PHP file. I just checked and it is 11,487 lines.</p> <p>That file, and another at 2,056 lines, are both included on every page of my development site.</p> <p>I am seeing no apparent performance problems.</p> <p>Perhaps I should explain why I have such a large file.</p> <p>I am focused on getting the entire program working. And I decided to just use that one file for most classes so that I could easily search it and make changes in any class without looking for a file. After I'm done, I'll split all the classes into separate files and use autoload to only load the required classes. That probably won't be for a few weeks, but when I do I will do some benchmarking before and after to see if there's any performance difference, but I doubt there will be.</p> <p>Right now, every page on my site loads that file. I just loaded the home page and according to Chrome it took 102ms. A page that actually use a lot of the classes and do some data intensive work and interacts with MySQL took 279 ms.</p> <p>So it seems to me that the file size does not get to be important until it is much larger than my 11,487 lines. For speed, you need to worry more about optimizing your code.</p> <p>For example, I just asked a question about array processing in which some solutions had my code run over 5 minutes, some 30 seconds, and a couple solutions at about 280 ms. Don't worry about file size!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload