Nitha Paul
Nitha Paul

Reputation: 1401

Launch time in Windows Phone 7

How i can reduce my launch time in windows phone, What all are the constraints that affects application launch time. While running Market place test kit sometimes it passes the launch time result and some time it fails; Actually i am struggling to identify the place it fails, How i can identify the place issue occurs, I try with performance analysis tool but doesn’t find any solution. And also another doubt regarding with this load time is that, how this load time is calculating wthr it is related to the loading of first page, or it checks the entire pages in the app. How i can reduce this load time.....

Upvotes: 3

Views: 934

Answers (2)

Jan Slodicka
Jan Slodicka

Reputation: 1515

Find out where is the load time spent. The technique is fairly easy:

public partial class MyPage : PhoneApplicationPage
{
    int m_t0;

    public MyPage() {
        m_t0 = Environment.TickCount;
        MyListBox.Loaded += MyListBox_Loaded;
    }

    void MyListBox_Loaded(object sender, RoutedEventArgs e) {
        Debug.WriteLine("\n---------> {0} msec", Environment.TickCount - m_t0);
    }
 }

Above code measures the time between the page construction and the instant when the listbox is loaded. This is the tool you can apply everywhere.

You could start in App.xaml.cs - it contains several interesting entries such as the constructor and app-level events, then go on to the page level and eventually measure interesting controls. If you want to measure xaml loading, measure the time spent in InitializeComponent() (debug this method - it is rather instructive) etc, etc.

It helps if you understand app life cycle, page and control loading.

At the end you should have a fairly good idea where is the time spent. Then you can start optimizing and eventually employ the techniques described by Ku6opr. You can get a lot more tips if you google for say "windows phone 7 performance".

Upvotes: 5

Ku6opr
Ku6opr

Reputation: 8126

First of all, put out all of your hard processing from Activated, Constructor, OnNavigatedTo and Loaded events. Make a delayed processing if it's possible (use BackgroundWorker, for example) Secondly - reduce your assembly size: make images as Content not Resource. Reduce your images size if it's possible (do no use image downsizing in your application at all), maybe separate your project into different assemblies if you have a lot of code that not used most of the time.

Hope it helps

Upvotes: 2

Related Questions