Timeline Viewer Concepts
As mentioned in Basic Concepts, the main idea behind timeline profiling is collecting temporal call stack and thread state data. Thus, it allows you not only evaluate the performance of certain methods but also get detailed info about how performance flaws are distributed in time. This is extremely helpful in analyzing UI freezes, sync delays, excessive garbage collections, file I/O, and other interval events.
Timeline Viewer UI is tailored for convenient work with the event timeline: It is a set of filters and diagrams that allows you to filter and visualize temporal data.
Analysis workflow in Timeline Viewer is quite simple:
To start, in Events, select any event in your application you are interested in. This could be the entire timeline data, garbage collection time intervals, memory allocation data, time intervals where your application worked with SQL servers, and so on.
Slice and dice the data using filters (Filters, Timeline, and Call Stack can apply filtering by time, thread, or particular method). The result of filters' work is always a set of time intervals or point events selected by a specific condition. For example, you can ask the viewer to "Select all time intervals where the Main thread is running" or "Select all time intervals where MyMethod() works ".
View and analyze the filtered data.
Here we come to a couple of concepts you need to know for successful data analysis in Timeline Viewer.
Everything is a filter
Both steps 2 and 3 are performed using the same UI controls. Thus, each control is used not only to set a specific filter but also to display a chunk of filtered information.
For example, the Thread State filter not only allows you to apply a filter by thread state but also displays how long selected threads were in particular states.
Filters are chained together
Filters can be grouped in chains. Complex filter combinations allow you to analyze almost any aspect of your app.
For example, if you combine the "Select all time intervals where the Main thread is running" and "Select all time intervals where blocking garbage collection is performed" filters, you will get the resulting filter "Select all time intervals where the Main thread is running during garbage collections". In other words, this filter combination will leave only the time intervals where the Main thread toggled GCs. The Call Stack | Top Methods filter will show you the exact methods that toggled collections.
Timeline Viewer integrated into Visual Studio
Timeline Viewer in Visual Studio is represented with the Performance Profiler tool window ( ). It is a counterpart of the standalone Timeline Viewer tailored for use within Visual Studio. The user interface of both tools is almost identical: the main difference is in how filters are shown on the main window (see the full list of differences ).