Al Chou wrote:
--- "Mark R. Diggory" <[EMAIL PROTECTED]> wrote:

Prior to my changes last night "increment" was actually calculating the
entire statistic. "getValue" was only returning the value of a precalculated
property. The problem is that the cpu cycles need to be "spent" no matter the
approach of full calculation in "increment" or "partial calc" in increment
and "partial calc" in getValue. I think addVAlue is going to get called alot
more than getValue, so I've optimized to reduce the amount of calculation
going on in increment as much as possible. (it would be possible to maintain
a boolean state about if "increment" has been called, this way calling
getValue repeatedly will not result in repeatedly calculating the same
statistical value over and over. I'll look into adding this.


Sorry to post-and-run, but I'm on a business trip this week.  The above is
memoization, isn't it?  Sounds like a good idea, especially for values that
take a lot of operations to compute.


Al



Yes, I've worked a bit on this for the incremental stuff, but havn't commited my changes yet. There's still some work I need to do.


-Mark


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to