Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Like other people have suggested, the main focus on file size should be towards readability and keeping the codebase understandable.</p> <p>However, regarding your original question regarding PHP file size and performance, it depends on what type of performance is needed. For PHP code that is executed infrequently--such as a PHP program executed on the client's machine via the command line, rather than by visitors loading a webpage--large file sizes may not be noticable.</p> <p>In contrast, in high-performance scenarios, even fairly small PHP file will consume substantial system resources. The general issue of PHP performance is what drove Facebook to write <a href="https://github.com/facebook/hiphop-php" rel="nofollow noreferrer">their own JIT virtual machine</a> for executing PHP code--because once-acceptable performance with PHP became horrifying as Facebook scaled up.</p> <p>The above is true for optimization in general--it is difficult to draw a line between good and bad performance without having a broader context to classify within. If you are concerned about the performance of your PHP code--whether file size-related or not--I recommend using a PHP profiler like <a href="http://www.xdebug.org/docs/profiler" rel="nofollow noreferrer">Xdebug</a> and monitoring the system resources on your server.</p> <p>EDIT, At the suggestion of <a href="https://stackoverflow.com/users/2167834/sebastien-renauld">Sébastien Renauld</a>, I add the following information about PHP and opcode caching to my answer. Rather than writing it all myself, though, I would like to point out the accepted answer on this <a href="https://stackoverflow.com/questions/2298196/php-include-file-size-performance">StackOverflow question that covers nearly the same topic.</a></p>
 

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