I’m working on a class in PHP which is now over 4800+ lines long (around 202KB currently) – it contains a large collection of functions. It’s almost a framework but not generic (or advanced) enough to be worthy of the term.
There is a __construct() function which connects to a database and runs one select query, and no public functions.
I simply include the file in the pages I need to use it on, and call it like so:
<?php $myFramework = new MyFramework(); ?>
Here’s my question – does the amount of functions in my class have any impact on performance over and above whatever impact the __construct() function has when it runs?
Does including a 202KB file slow down my web app in any way, such that it might be advisable to split my functions into smaller files?
Only in you case, but not generally:
If talk about speed, splitting your functions into smaller files will increase count of includes and slow your application down much greater.
As you say, your methods are logically dealed, so you may keep your code as it is.