
Originally Posted by
Lemon Juice
Generally, the more files you load the longer the script runs so having as few files as possible is best from performance point of view.
However, not splitting parts of your code into many files in a large application would be very messy and hard to maintain so it doesn't make sense to do that. File access is not a huge performance hit so in most cases there's no need to worry and until it becomes a problem I wouldn't try to pack everything into one file. Moreover, opcode caches like APC, PHP Accellerator, etc. can speed up includes a lot by caching them in memory.
It's good to keep each class in a separate file. It makes navigation around your code convenient and you can easily set up class autoloading to avoid unnecessary includes every time you use a class.
Bookmarks