It's too slow because using layout to create window

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

silentyears
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Wed Sep 11, 2013 11:17

It's too slow because using layout to create window

Postby silentyears » Wed Nov 13, 2013 12:31

Hi, here is my question.
Every time i run my app, it will use too much time to start because i using .layout file to create GUI windows and there are a lot of windows, so is there any good advice or clever way to solove it ? :?:
Thank you very much! :)

User avatar
mmixLinus
Quite a regular
Quite a regular
Posts: 71
Joined: Fri May 20, 2011 08:46
Location: Lund, Sweden
Contact:

Re: It's too slow because using layout to create window

Postby mmixLinus » Mon Nov 18, 2013 14:40

Hi silentyears

I have the same "problem", but it is probably mostly due to a design choice I made early in my project. It loads the layouts, and creates quite a few windows, most of which I don't actually need right at startup.. :oops: Eventually, I will solve this by creating the windows when they are needed.

I haven't looked into putting the layouts into a compressed file, but this might help a bit.

/mmixLinus
MMiX.Me 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)

silentyears
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Wed Sep 11, 2013 11:17

Re: It's too slow because using layout to create window

Postby silentyears » Tue Nov 19, 2013 11:31

mmixLinus wrote:Hi silentyears

I have the same "problem", but it is probably mostly due to a design choice I made early in my project. It loads the layouts, and creates quite a few windows, most of which I don't actually need right at startup.. :oops: Eventually, I will solve this by creating the windows when they are needed.

I haven't looked into putting the layouts into a compressed file, but this might help a bit.

/mmixLinus



thank you! and what do you mean to put the layouts into compressed file and how?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: It's too slow because using layout to create window

Postby Kulik » Tue Nov 19, 2013 12:07

Use rapidxml, be smart about layouts. Loading everything up front and reusing will increasing responsiveness (by getting rid of any stalls), lazy loading will make it start quickly but stall when a new layout has to be loaded.

There are many general programming solutions to this but in the end you have to load the layouts, it's going to take time...

Not sure what to advice here, the question isn't clear enough.

KishukuOni
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Wed Nov 25, 2009 17:41

Re: It's too slow because using layout to create window

Postby KishukuOni » Thu Dec 19, 2013 21:44

For us the slowdown was more in creating all the windows, not parsing the xml. Regardless, we now load in stages.
We load one layout at start-up. This is a simple loading screen layout with a progress bar, a fancy background, and some text.
Then we show that screen while we load the main menu and a few other layouts needed there. Then when the user starts a game it loads the rest of the game files, graphics, and the rest of the layouts. (showing a loading screen once again).

This makes getting to the main menu still pretty quick, plus there is no blank empty screen at startup. I feel like this is how many mainstream games work and users expect this kind of behavior.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 19 guests