[UPHPU] performance hit recalling functions?

Daniel C. dcrookston at gmail.com
Sat Dec 19 08:57:16 MST 2009


Why are you asking?  Do you have code that's taking too long to run,
and if you do have you tested it and found that count() is what's
making it take too long?  Because if neither of these are the case,
then what you're doing is premature optimization, which we all know is
the root of all evil.

(But since you asked, it probably will, but to know for sure you'd
need to do it both ways, time them both and compare.)

-Dan

On Fri, Dec 18, 2009 at 11:38 PM, Wade Preston Shearer
<wadeshearer.lists at me.com> wrote:
> If you are going to be calling a function (such as count() a few times
> within a script, is there any performance benefit to calling it once
> at the beginning, storing the result in a value and then using the
> value instead of recalling the function each time?


More information about the UPHPU mailing list