locked
Slow App startup on Windows Phone 8.1 runtime app on HTC 8S and HTC 8X

    Question

  • Hello,

    an app I am writing has a really bad startup time (ranging from 3-5 seconds) on the HTC 8S and HTC 8X with developer preview. The strange thing is that even if i do not show any content and do not invoke any custom code (all code is invoked asynchronous, any way), it takes that long, and it looks like only the loading of the runtime assemblies (Windows Phone 8.1, .NET for windows store apps) take that long to load.

    When i test the app on a Lumia 930 it takes less than a second (and from what i can tell, less than 400ms when not in debugging but in release mode, in release it starts nearly instantaneous).

    Of course i know that the Lumia 930 is faster than the other two phones by a large amount, but this performance just is not good at all. What makes it worse is that the app is cleared quite fast from memory and needs to fully load nearly every time I start it (when i just hit the home button and then the back button, it stayed in memory all of the time, but this is not the usual "business case"). This was not the case when I developed the app as a Silverlight Windows Phone 8 app. It happed right after porting the application to a Windows Phone 8.1 app.

    I do to have any other phones available that ship with WP 8.1 from the beginning, so I do not know if this is only a problem because I have WP 8.1 via the developer preview.

    So my questions are:

    1:

    How can I reduce the startup time to less than a second (please keep in mind, it does not take longer because of my custom code but by default, with the basic settings from Windows 8.1 Hub app template), and if there is not any way to optimize startup time, then...

    2:

    what can I do to keep the application as long as possible in memory and not cause a full restart of the app, if the user opens it in, lets say, 20 minutes and more.

    Please keep in mind, the performance on a Lumia 930 is perfectly fine (the application gets cleared from memory as fast as on the HTC 8S/X, which  is strange because it has 2gigs of RAM, but the app starts nearly instantaneous, nevertheless), but the startup performance on older devices with the developer preview is really bad and might not be tolerated by the users.

    Thanks in advance.

    Wednesday, December 3, 2014 8:18 PM

All replies

  • Hi AK Interactive,

    >> How can I reduce the startup time to less than a second (please keep in mind, it does not take longer because of my custom code but by default, with the basic settings from Windows 8.1 Hub app template), and if there is not any way to optimize startup time, then...

    We have some ways to improve performance on startup time, you can see more information about this from the following links. But there is no options to intervene the execution of operating system.

    http://msdn.microsoft.com/en-us/library/windows/apps/Hh994639.aspx.

    http://msdn.microsoft.com/en-us/library/windows/apps/hh771190.aspx.

    >> what can I do to keep the application as long as possible in memory and not cause a full restart of the app, if the user opens it in, lets say, 20 minutes and more.

    There is no way to keep the app in background in memory as long as possible.

    The operating system attempts to keep as many suspended apps in memory as possible. Keeping these apps in memory ensures that users can quickly and reliably switch between suspended apps. However, if there aren't enough resources to keep your app in memory, the OS can terminate your app.—you can find more information from http://msdn.microsoft.com/en-us/library/windows/apps/hh464925.aspx.

    Based on my knowledge, do you want to remember the last visited page and content on it when user leaves the app and help the user to continue work when they resume the app? We can use code to let the app performs like keeping itself in memory. See more information about handing suspend, resume and activation from http://msdn.microsoft.com/en-us/library/windows/apps/xx130647.aspx.

    Please feel free to let me know if you have any concerns.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, December 4, 2014 6:50 AM
    Moderator
  • Thank you for your suggestions,

    I already store specific information (like the current index of the pivot control) so i start exactly where the user stopped using the app, but the time from invoking the application from the main tile / app list to the time when the loading screen disappears and the application is shown is really disturbing (as I said, three to five seconds).

    Even if I do not not bind my Main Viewmodel to the page and only display a blank page, it takes that long.

    I just created a fresh new hub application and flashed it on the 8S. The applications starts up faster, but it still takes one to two seconds in release mode.

    As i do not use any assets in my application, the increased startup time in my app must be related to the amount of classes that I use (otherwise, it should not take longer to start, from my point of view).

    Using NGEN might improve startup time, but shouldn't an app that was pushed to a test device in release mode be as fast as if a user downloads the application from the store?

    What concerns me most is that when I developed the app as a silverlight app, there were no such problems. The startup was perfectly fine and the application stayed in memory like forever.

    So the problems only occurred on lower end devices like the HTC 8S/X after switching to the runtime app model.

    I checked the used RAM in Visual studio (performance diagnostics) and I saw that the application takes about 30mb on the devices. I understand that this might be a problem on devices with 512mb RAM, but why does the Lumia 930 releases this app so aggressively from memory (it is a music app by the way, using a background audio task).

    I will take a close look at the performance diagnostics tool in visual studio, maybe I can figure out how to improve the startup time this way.

    Thursday, December 4, 2014 7:06 PM