Page 1 of 1

Minimizing load times

Posted: Mon Jul 01, 2013 11:06 pm
by SteveTX
My app is a single card, and takes approximately 15 seconds to load, meaning there is a black screen for about 15 seconds until it finally pops up. Is there a way to shorten the loading time, and/or to determine what is causing the delay?

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:12 pm
by Dixie
Would need to know a lot more than you are telling us... Is this for mobile ?... Does it take 15 seconds in the simulator or on a device?... What is in your openStack and/or your openCard handler ?...

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:24 pm
by SteveTX
This is for mobile. It takes 15 seconds on an 800Mhz ARM6 device, and about 10 seconds on an 1Ghz ARM7. Never run it in a simulator.

No open stack handler, only a pre open card handler that dynamically generates the graphic objects and layout of image and label objects.

Code: Select all

on preOpenCard
   put 0 into MinX
   put 0 into MinY
   put item 3 of the screenRect into MaxX
   put item 4 of the screenRect into MaxY
   call createLayout
   pass preOpenCard
end preOpenCard

command createLayout
   lock screen
   ( 600 lines of setting widths, heights, lefts, tops, rounding calculations, 10x graphic resizes, setting object styles, ~40 label creations, ~70 graphic line draws)
   unlock screen
end createLayout

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:34 pm
by Simon
and/or to determine what is causing the delay?
Start removing objects from the stack.

I found that a field with many lines of text does slow the opening of a stack in the sim and on device.

Simon

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:37 pm
by SteveTX
I only have a single multiline label. the rest are single line, one or two words.

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:39 pm
by SteveTX
fyi, all those lines are antialiased. also, what is the calculation difference between resize quality good vs best?

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:43 pm
by Dixie
Instead of using a 'preOpenCard' handler, try using 'openCard' ... and instead of the call command, you might try

Code: Select all

 send "createLayout" to this card in 100 millisecs

Re: Minimizing load times

Posted: Mon Jul 01, 2013 11:53 pm
by SteveTX
Excellent. For some reason, using send vs call shaved 2 seconds off the load time on the ARM7 device.