Can a PHP application have too many functions? Does the execution of a large number of PHP functions hog memory and resources? My WordPress theme in-development has a lot of functions (probably more than 100 by the time I'm done) and I'm concerned that I might have too many.
Even if many functions led to more memory consumption, I'd advise you to use them anyway. A clear structure is much more important than performance.
Performance can be improved by throwing hardware at it, a badly structure application gets quickly very hard to maintain.
By the way: 100 functions are nothing!
100 functions is nothing to worry about. If your code is slow you should profile it to explicitly find the slow parts.
Remember, premature optimizations are evil
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With