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!
It's too slow because using layout to create window
Moderators: CEGUI MVP, CEGUI Team
-
- 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
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.. 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
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.. 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)
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
(YouTube|Facebook)
-
- 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
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.. 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?
Re: It's too slow because using layout to create window
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.
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.
-
- 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
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 12 guests