Performance Mystery Solved - IT'S THE DATA STUPID!!
ambassador at fourthworld.com
Thu Nov 11 19:54:53 EST 2010
Peter Haworth wrote:
> Figured out the IDE/Standalone performance issue, it's nothing to do
> with the code.
> I my last email I mentioned how I have a custom property holding the
> long names of all the controls on a card that need to have data loaded
> into them from my database. On closer inspection, the long name
> includes the name of the stack file which - duh - is my .rev file!!!
> So when the standalone gets the long name of a control from the custom
> property, it is referencing the control in my.rev file, not the
> control in the standalone, and presumably has to go open the .rev file
> every time my code refers to a control. No wonder everything took
> longer. Using the ID removes that problem of course.
Bad news: I don't think that's the problem.
Unless you're explicitly purging the stacks, any access to a property of
a stack file will load it into memory. The first access will take a hit
only if the stack isn't already in memory, but subsequent accesses
should be about as fast whether referring to just the stack name or the
stack file path, since they're interchangeable for mainstacks.
Moreover, if the data stored in the standalone is subject to change,
you'll want to migrate that to a separate stack file anyway since the OS
doesn't allow executables to modify themselves.
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
More information about the Use-livecode