Painfully slow performance

Web Admin Himalayan Academy katir at hindu.org
Sat Nov 6 16:02:30 CDT 2010


  On 11/6/10 8:30 AM, Peter Haworth wrote:
> I just built my first standalone with LiveCode 4.5 (on OSX) and I'm 
> seeing painfully slow performance compared to the same application 
> built with 4.0.
>
> I'm using an SQLite database to populate all the data on the cards in 
> the app, not sure if there's some problem with the SQLite side of 
> things.  Only other thing I can think of is that I am using several 
> front scripts.  Opening a card used to be almost instantaneous, now 
> it's taking 30-45 seconds.  Bringing up the data for a different 
> SQLite row used to be instantaneous, now takes 10 seconds or so.  This 
> is consistant across all the cards that handle data fro any table in 
> my SQLite database.
>
> The 4.0 standalone still works just fine using the same database.
>
> Any ideas?
> Pete Haworth

Disclaimer: this may having nothing to do with your issue and does not 
explain why it was fast before... but still good to remember:

Are you feeding the data to the fields row, by row, or do you get all 
your data into a variable and then post it to the field after the query 
is complete?

this is construct from a sample stack made available in 2006:


   if recNum > 0 then
     repeat recNum times
       put empty into tRec
       repeat with c = 1 to colNum
         -- put revDatabaseColumnNamed(curID, line c of colNames) & tab 
after tRec
         put revDatabaseColumnNumbered(curID, c) & tab after tRec
       end repeat
       put tRec & cr after fld "Select"
       -- revMoveToPreviousRecord curID
       revMoveToNextRecord curID
       if the result = false then exit repeat
     end repeat
   end if

this was painfully slow!

when I replaced this line:

put tRec & cr after fld "select"

with

put tRec & cr after tResultSet

end repeat
end if

put tResultSet into fld "select"

the whole thing went from "painfully slow" to "nearly instantaneous"

and I have confirmed this many times: updating a field, line by line is 
hard, for example if your results comprise 650 found rows...  because 
(I'm guessing) you are forcing the stack to update itself 650 times... 
whereas, if you poke a variable and *then* push it to the GUI you are 
asking the stack to only update itself 1 time.

HTH









More information about the use-livecode mailing list