calculations getting called like mad; sometimes.

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.

Are you working on 2.1 or 2.0.
With calculations I assume you mean calculated fields?

If so, can you tell if these calculations are stored or unstored?
And, if they are unstored what happens when you make them stored?

hi marcel;

using 2.0.3 build 276

i guess i mean calculated fields, yes.

i don’t have any stored calculations anywhere in the app;

Robert, I would upgrade to 2.1 if I were you. When you read the notes about 2.1 you will see ‘[enh]-Performance optimize on calcs and lookup fields’ which is what you need. If I remember correct this solves you multi-fire-problem.

thank you.

we’re looking very seriously into doing this, but we’re
supposed to deliver this package in about 8 days, and
we’re very concerned about making a change of that
magnatude so close to product rollout.

i’ll probably start experimenting with 2.1 very soon though.

thanks again for getting back to me.

rm.

Robert, just to let you know: I changed my clients Servoy install from 2.0 to 2.1 this weekend. Can’t give any client feedback yet but I haven’t seen any issue apart from the global datefield behaviour that changed. As you might know my appication is quite big so this should say enough. Again, if I were you, I would give it a try on another machine to see what goes on! It is worth it!!!

IT2BE:
Again, if I were you, I would give it a try on another machine to see what goes on! It is worth it!!!

i think you have me convinced. i just may try it tonite.

thanks again for all your help. i hope i can return the
favor at some point.

Don’t forget your backups :-) Just in case…

it’s running now as we speak! (or type)

by the way, will i have any difficulty going back to
2.0.3, if for some reason 2.1 doesn’t work out?

i remember that 2.0.3 uses the firebird database;
i’d really hate to get in a “jam” over this…

thanks.

Great Robert.

2.0 Was already delivered to us with Sybase. Don’t know what you installed though. You’d better check that. On the other hand working with Firebird or Sybase doesn’t really matter as long as you export/import the solution.

Unfortunately going back from 2.1 to 2.0 is not possible. You probably noticed that your repository was updated. And not only that, also the Sybase version was updated to 9.0.1…

Did you already check your calculations? I am very curious what the outcome is…

IT2BE:
Unfortunately going back from 2.1 to 2.0 is not possible.

really?? i’m glad you told me this;
i was just about to “take the plunge”.

can you tell me why i’d be unable to go back to 2.0.3?
i’m not sure i understand.

It’s your Repository. This version is different from the previous one and therefor you won’t be able to go back…

You can go back to 2.0.x but you can’t just downgrade the software.

When you are in 2.0 you should export the solution into a .servoy file. This is your backup of your solution.
Also make a backup of your servoy.properties file. This contains the database connections.
Then upgrade to 2.1 and it will update your respository to the new format.

When you need to downgrade just kill the database server, remove the servoy folder (wich includes the repository database) and do a fresh install of 2.0.x. Copy back your previously backuped servoy.properties file and then import the previously saved solution.

It sounds like a lot but it’s pretty simple.

Hope this helps.

Hmm, I think I have to add something to the last two posts.

  1. One can NOT downgrade just like that from a 2.1 solution to a 2.0 solution. It is also not possible to use a 2.1 export on a 2.0 installation…

  2. Offcourse you can go back from a complete 2.1 installation to a 2.0 installation. The only thing you need to do is make a backup of your complete Servoy directory (remember to first stop Sybase) and, optionally, zip it. You can now upgrade your Servoy installation and test it. When something is wrong you can simple throw away your fresh install (again after stopping Sybase) and place your backup back. You are now exactly where you were before the install of 2.1. No need to make exports or whatsoever in this case.

makes sense to me. i understand that i can not work on my
project in 2.1, export it, then go back to 2.0 and import it.

that was not what i wanted to do.

i just want to be able to get back to where i was, in
case the move to 2.1 causes trouble, and pick up
where i left off.

thanks very much for responding guys!