I've just finished writing a pretty big class, and its turned out to be noticeably slow (when executing a function from).
The class contains 3 public functions and atleast 10 private functions, resulting in 1,569 lines of code (a fair amount of that is also comments).
Now I must admit, there is allot of singing and dancing going on behind the scenes when calling one of the public functions, but the response time is so bad, the class is not even worth using.
The class file size is 57KB. I'm wondering if the file size is the problem here, or is it just simply because of the code I'm executing - So can I just break the file down, or am I going to have to make drawbacks to my code?
I've also tried simply including the class file from another file, and the same goes...
In case this does any good:
1.) There are quite a few functions in the class that involve file reading/writing (such as file_exists()
,fopen()
,fwrite()
,ect ect)
2.) There are no database queries/connections
3.) There are no huge
(over count of 20) loops
Any help is much appreciated!