One of the topics he discussed about, which I found very interesting, was the way you can use xperf to analyze the startup time of your WinRT apps.
Here is what you need to do for capturing startup events:
- Get Windows ADK from here
- Get the script for controlling the profile from here
- Run the script (as Administrator). It will start the profiler and will wait for a keystroke before stopping it.
- Exercise your WinRT app. Make sure the app was closed before you run it so that you capture the startup events.
- Hit any key on your script window which will stop the profile and generate several .etl files.
Analyzing the startup events:
- Double click to open the generated xaml_merged.etl with Windows Performance Analyzer
- In Graph Explorer expand the System Activity
- In System Activity locate Generic Events and drag it into the empty canvas on the right.
- Close Graph Explorer and click on the Display graph and table icon on Generic Events
- Expand Microsoft-Windows-Immersive-Shell and locate AppShown event
- Notice that when you select the AppShown event, an area of the graph is highlighted. Right-click it and select Zoom
- Expand Microsoft-Windows-XAML and locate ParseXaml event
- Now you should be able to observe all events that might impact your startup time. You can also observe the total startup duration at the bottom of the window
Make sure to get rid of any unneeded resources you might be loading so that you load only the bare minimum you need on the first page of your app. Keep in mind that your users might be running your app on less powerful hardware than your development machine.
I strongly recommend watching Kiran’s presentation for more interesting facts and best practice for optimizing the performance of your WinRT apps.
One more thing 🙂
I found this technique extremely useful while I was working on my Win8 app Puzzle Frenzy.
The app is available in Windows Store, check it out and tell me what you think: http://apps.microsoft.com/windows/en-GB/app/puzzle-frenzy/28238e98-ac0f-4a6b-81ea-a31a24a15acf.
You can also give your feedback on app’s review page or on app’s Facebook page http://www.facebook.com/PuzzleFrenzyApp.