LoadLayout quite slow

corwin42

Expert
Licensed User
Longtime User
In my weather app I use 24 Panels in the main GUI which get initialized at App startup. Every panel loads its own layout with Panel.LoadLayout(). I had the problem that the GUI initialization took very long (up to 10 seconds on my device).

First attempt to make this faster was to load the layouts for the panels only just before they get displayed (and this only once of course). This worked well for the "normal" panels but the 10 day forcast panel with 10 subpanels was still very slow when it got displayed the first time.

Then I tried to create the panels and their contents programatically. This did the trick. Doing this is MUCH faster than loading a layout with LoadLayout(). GUI initialization is now done in under a second. Are there any tricks to speed up layout loading with LoadLayout() or can this be optimized in the future?
 

corwin42

Expert
Licensed User
Longtime User
I just sent you the project by mail.

The .bal files have just a few kb. I removed some images from them that are not really needed. It seems to be slightly faster now.

Still a big difference on my device: 6 seconds GUI Init with LoadLayout(), <1 second with programatically Layout.
 
Upvote 0

MiniDemonic

Member
Licensed User
Longtime User
Necroing this, but shouldn't it be possible to just load all layouts when the program is first started, with a progress bar showing the user how much left untill the program is ready.

Should make LoadLayout faster if it's only slow the first time it loads.
 
Upvote 0
Top