my client yesterday complained of severe slowness when testing
the servoy application i’m building for him, especially when running
a specific method (“GenerateQuote”).
this method looks thru many different fields in the data, and
builds formatted html output on a printed page. i didn’t expect
it to be ‘lightning fast’, but i was rather suprised at the performance.
the problem wasn’t that the execution of the method was horribly slow, it
was that the performance would vary - greatly - from one execution
to the next.
in a effort to better understand what was going on internally,
i put some M-^Sapplication.output()M-^T statements in a few of my
calculations, to try to get a feel for when, and how frequently,
theyM-^Rre being called.
i also put a few of these in the GenerateQuote method, and kept
track of the elapsed time spent executing it.
wow, was i suprised! these calcs are getting called over &M- over
& over again every time the user enters or changes anything,
anywhere on a form.
now, i expect the calcs to fire when things change, thatM-^Rs what
theyM-^Rre supposed to do, but i was real suprised to see how many
times the same calcs were firing.
so, knowing that, i went back to the method that the client was
complaining about, and caused it to execute. to my supirse, calcs
were firing like mad. and not just the calcs that the method calls,
but calcs that have nothing to do with the method being executed.
then i saw what has to be the strangest thing yet: the next time
i ran the method, no calcs, other than the ones used by the method,
were called. no code change, no data change, no one else doing anything
else on the machine but me, and the methodM-^Rs execution time dropped
from 12 seconds to 2.
i really need to understand when/why calcs are fired, especially during
execution of a method that makes no reference to them,
and how to take controll of this.
this client is already disappointed about many setbacks we have
encountered. if i could get the performance improved, we just
might be able to make him happy.
thanks in advance.
rm.