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.
- 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.
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.