[eluser]jedd[/eluser]
My question on this subject:
How do you guys reduce the size of your controller? The only way I could see, other than modifying the design such that you have more controllers doing less things, is to have methods in a sub-directory, relatively pathed in require() calls, and that require() call is pretty much the only thing in the function in the (main) controller file. I can see one prima facie benefit - code only gets read in when it's definitely going to be used.
I suppose it comes down to design approach, coding style and self-discipline as to whether not being able to see the contents of each method easily while surfing through your controller would be a hindrance or a benefit. With a decent IDE (I use Quanta and it *mostly* does this elegantly) you have a document-structure tree to help you navigate around - take you straight to method names f.e., and that might affect your decision.
OTOH, to answer the question, extrapolating from what I have here, I'd say an average of around 600 lines. But my code contains a heck of a lot of white space. My average would work out to be about 16KB - very rough estimate. I suspect this equates to maybe 2 or 4 reads (at a file system level).
Plus I'd
expect it'd be impossible to measurably identify any performance delta between 600 lines and 100 lines of code, even with the above require() style approach to each method's guts, given the way PHP is optimised and considering the rest of the disk activity kicked off by a page hit.
Mind, I can only comment on jedd practice, not best practice.