Performance Analysis Tool for UWP Applications

## Introduction
In Visual Studio, we have <b>Performance Profiler</b> tool that enable us to analyze application interaction-related performance issue in our XAML Universal Window Platform Application. Performance is the critical aspect of any application. It can influence the user's perception of the entire application. The application profiling tool helps us to improve the performance by providing a semantically-rich, scenario centric view of our application's resource consumption. We can analyze the time spent by the application preparing UI frames, servicing network and disk requests, and much more scenarios like application start up and page load.
## How to use the tool?
To open the <b>Performance Profiler</b> tool in Visual Studio, click on <b>Analyze</b> from the main menu and select <b>Performance Profiler</b> or simply use the shortcut (ALT + F2), and we can stop the analysis process by clicking on the link in Visual Studio and it will automatically generate the diagnosis report for us.
![4024.Start_thumb_56B71C4C.gif](https://qiita-image-store.s3.amazonaws.com/0/211892/668f13df-9cc3-84d1-73cc-58aff4178723.gif)
Now we can check the performance report for optimization.
![8255.FinishProfiling_thumb_790EB1C5.png](https://qiita-image-store.s3.amazonaws.com/0/211892/34d24561-42fd-f261-0576-a47bc35787fd.png)
## How to inspect the report?
The report lists all events in our application, which correspond to the CPU consumption during our application's execution.
### Graphs
![8267.Grpahs_thumb_06CFBBEF.png](https://qiita-image-store.s3.amazonaws.com/0/211892/318cec19-7712-b0f7-e35c-92d17a6fde80.png)
In the top most of the report, it shows the UI thread utilization of the application. It spots out the detail of UI thread utilization and the low frame rate which might correspond to poor application responsiveness.
### Details View
Right in the bottom most of the report is the details view. It shows us the details of CPU utilization of the application.
<b>XAML:</b> Layout, Parsing, Render
<b>System:</b> Disk, Network
<b>Other:</b> Garbage Collection
![0247.UI-Enhancements_thumb_3B70182A.png](https://qiita-image-store.s3.amazonaws.com/0/211892/94befa1a-34f5-02f8-97ab-3bfdc6cfa18e.png)
These UI enhancement can be turned off by using <b>View Settings</b> in the command bar of the details view.
![6330.ViewSettings_thumb_16E6128A.png](https://qiita-image-store.s3.amazonaws.com/0/211892/7e5c1644-691d-19b0-9446-5291f2b032e4.png)
<b>Layout:</b> In large applications, often thousands of elements are shown on the screen at the same time. This might result a low UI frame rate that correspond to the poor responsiveness. We can use this visualization to determine which of our logical trees need pruning, to optimize the layout.
![6266.Layout_thumb_6D7BB70D.png](https://qiita-image-store.s3.amazonaws.com/0/211892/af425d52-c9fd-e10b-7647-3bbef4d745b0.png)
<p>Parsing:</p> It indicates the total amount of time spent by the UI thread in parsing XAML files and creating objects.
![4111.Parsing_thumb_060B545E.png](https://qiita-image-store.s3.amazonaws.com/0/211892/c377d1fa-99bf-bd0d-17ca-3509c03839c9.png)
<b>Application startup:</b> It measures the interval between the application launch by the operating system to the time taken for the application to the submit the first frame to the Desktop Window Manager.
![1070.AppStartup_thumb_73C28D9B.png](https://qiita-image-store.s3.amazonaws.com/0/211892/0d3380b8-299b-605d-ddb5-004c349c90f2.png)
So these are all the main stuff about UWP performance review in Visual Studio.
Reference: <a href="https://blogs.msdn.microsoft.com/wpf/2015/01/16/new-ui-performance-analysis-tool-for-wpf-applications/">https://blogs.msdn.microsoft.com/wpf/2015/01/16/new-ui-performance-analysis-tool-for-wpf-applications/</a>