Question

I am in the process of writing a class that will probably end up being around 3000 lines of code.

What I would like to know is very simple, will initiating this class at the top of each page slow down the runtime of the page, even though only one/two of the objects methods will be used? Is it going to put a lot more strain on my server if it is being accessed several thousand times a day?

If so, should I be looking at creating extensions to handle each method instead of having the whole class in one file?

EDITED

Firstly, just to correct KingCrunch and Kenaniah, this class is for my API, which resultantly means that it holds a lot of functions for retrieving data to be displayed on the website and our iPhone Application, along with our entire Facebook Application. So 3000 lines is pretty damn small given the size and capabilities of our website, not to mention that over 700 of these lines are comments. So I can assure you there is no design flaw, although there may be a structural flaw, which is why I am asking this question...

The construct function simply sets the default values to the defined variables, nothing more.

I have completely rewritten this file from scratch so there is no old code and I am pretty sure the methods within the class are as efficient as they can possibly be.

I have been monitoring my server usage etc, as well as simulating high volumes of traffic using the apache ab tool and although my memory usage shoots up, it does seem to be okay.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top