Minimizing load times

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Minimizing load times

Post by SteveTX » Mon Jul 01, 2013 11:06 pm

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?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Minimizing load times

Post by Dixie » Mon Jul 01, 2013 11:12 pm

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 ?...

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Minimizing load times

Post by SteveTX » Mon Jul 01, 2013 11:24 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Minimizing load times

Post by Simon » Mon Jul 01, 2013 11:34 pm

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Minimizing load times

Post by SteveTX » Mon Jul 01, 2013 11:37 pm

I only have a single multiline label. the rest are single line, one or two words.

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Minimizing load times

Post by SteveTX » Mon Jul 01, 2013 11:39 pm

fyi, all those lines are antialiased. also, what is the calculation difference between resize quality good vs best?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Minimizing load times

Post by Dixie » Mon Jul 01, 2013 11:43 pm

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

SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

Re: Minimizing load times

Post by SteveTX » Mon Jul 01, 2013 11:53 pm

Excellent. For some reason, using send vs call shaved 2 seconds off the load time on the ARM7 device.

Post Reply