Posts:
5
Registered:
4/27/10
|
|
|
|
Startup time
Posted:
May 7, 2010 5:18 PM
|
|
|
Right now it seems to take about 5 seconds between when my app is selected from the main menu and when my create() method is called. Is there a way to get more insight into whats happening during this time, or do you have any tips for minimizing it?
On a side note, it would be great if we could supply a splash screen image that you would pop while an application loads.
|
|
 |
Posts:
186
Registered:
3/11/10
|
|
|
|
Re: Startup time
Posted:
May 10, 2010 11:29 AM
in response to:
dancspryfox
|
|
|
I did some tests and found the time between the user selecting an app and create being initiated much less than 5 seconds. In fact it was even less than a second.
The only thing that we would like to highlight is that you shouldn't try to load the entire UI within create. Don't try to load all the images ect, instead try and do it lazily. When starting an app, try and go with the most minimalistic approach. The splash screen idea is a great idea, however you would want to make sure you don't load an extremely large image or a very processing intensive animation at the start since that will slow up the loading of the app. Hope this helps.
|
|
|
 |
Posts:
25
Registered:
3/7/10
|
|
|
|
Re: Startup time
Posted:
May 10, 2010 11:32 AM
in response to:
zainkindle
|
|
|
Well, with a 11 kb splash image am getting 3 seconds for the image to load and an overall 4 seconds extra time to stat-up. It's .9 to 1.4 seconds for the App Name to show up at the top bar and after that a very simple app takes just a second or less. Anything with images takes 3 to 4 seconds. Could you please add a code snippet that uses a splash screen and loads up quickly.
|
|
|
 |
Posts:
32
Registered:
2/24/10
|
|
|
|
Re: Startup time
Posted:
May 10, 2010 6:41 PM
in response to:
zainkindle
|
|
|
Zain, I'm not sure what kind of a project you used to test. Is it possible that substantial projects with a lot of Java code take more time to load code etc. before create() is called?
|
|
|
 |
Posts:
186
Registered:
3/11/10
|
|
|
|
Re: Startup time
Posted:
May 12, 2010 12:06 PM
in response to:
halwass
|
|
|
Yes, you are definitely right about that. Larger jar files will definitely take longer to load than smaller files. I am redoing some of the benchmarking. Will let you guys know once I get the results compiled. Thanks
|
|
|
 |
Posts:
14
Registered:
4/21/10
|
|
|
|
Re: Startup time
Posted:
May 12, 2010 8:16 PM
in response to:
zainkindle
|
|
|
For reference, my .jar is now 443k, I am suspicious that the time is jar decompression and class loading but it still seems slow.
|
|
|
 |
Posts:
32
Registered:
2/24/10
|
|
|
|
Re: Startup time
Posted:
May 19, 2010 9:44 PM
in response to:
zainkindle
|
|
|
Followup related to this issue: I just did a test of a trivial app that does nothing but load and display an image the size of the whole Kindle DX screen (i.e., the image is 824-by-1160; it also happens to be black-and-white, which should speed drawing). I.e., the main code is:
public void create(final KindletContext newContext) { Image image = Toolkit.getDefaultToolkit().createImage(getClass().getResource("title_dx.png")); KImage kImage = new KImage(image); newContext.getRootContainer().add(kImage, BorderLayout.CENTER); }
Result: from when I press the 5-way controller on my Kindle DX to request that the app launch to when the image completes drawing on the Kindle's screen, the time is about 7 seconds.
The real app I'm working on, which has a similar-looking startup but much more Java code to load, some assorted setup, etc., takes 9 or 10 seconds to reach the same point.
Is this acceptable -- and indeed as good as can be expected -- for startup of a non-trivial graphics app on a Kindle? If not, how can we do better? I'm a little worried that you will demand in your review process that apps start fast, while at the same time presenting us with a situation in which that goal is difficult or impossible for a non-trivial app to attain.
By the way, I notice that the standard Kindle DX screen-saver seemingly loads and displays beautiful, full-screen, grayscaled images in less than 2 seconds! How do you do it?? Can you show me how to rewrite my code above so as to attain similar startup performance?
Thanks, Hal
|
|
|
 |
Posts:
14
Registered:
4/21/10
|
|
|
|
Re: Startup time
Posted:
May 12, 2010 8:15 PM
in response to:
zainkindle
|
|
|
Just to clarify, the ~5 seconds I am seeing is before my create() is called. This is all sort of estimated since all I have is a logged timestamp from when the method is called and a stopwatch.
I have moved nearly everything out of the lifecycle methods and into separate threads. My splash screen now has only one 0.2k image and some text which I draw with my own paint() - no controls.
|
|
|
|
|