Getting Started with Timeline

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Modern apps tend to be multithreaded. Background data caching, background search, and so on: Even in a simple app you’ll definitely find a process that can be run in a separate thread. Unfortunately, in addition to obvious benefits, this also makes your app more complicated and more difficult for debugging.

What Is Timeline?

To help you profile multithreaded apps, dotTrace 6.0 introduces a new view called Timeline. Timeline is a set of filters and diagrams that allow you to quickly visualize and analyze threads and thread-to-thread relationships in your app. The purpose of Timeline is answering main questions related to poor performance of multithreaded apps:

  • What causes UI freezes in my app? Is this excessive computational work in the main thread, multiple garbage collections in worker threads, or maybe it’s an overuse of I/O operations?
  • Is poor performance caused by a concurrency issue like lock contention, irregular work distribution, or other?

Timeline Is Not “Just a View”

Nevertheless, don’t think of Timeline as of just one more dotTrace view made “specifically for multithreading”. It is much, much more than that. In addition to capabilities described above, you can use Timeline as an ordinary profiler: dig into the call stack, view execution times and the source code of methods in the stack, and so on. Actually, you can do performance profiling in Timeline without the need in other views at all. Yep, Timeline is more a profiler in a profiler than just a view.

What Next?

In this “Getting Started” tutorial we will take a detailed look at the Timeline user interface and even try to solve a very common task – finding a reason of UI freezes in an app.

Contents

Sample App
Running the Profiler and Getting a Snapshot
First Look at the Timeline’s User Interface
Analyzing a Snapshot in Timeline
Analyzing File Operations and Garbage Collections in Timeline

Sample App


As an example, we’ll use a small app used to reverse lines (e.g., "ABC" > "CBA") in text files. Briefly: With the Select Files button, a user specifies text files to be processed. The Process Files button runs a separate BackgroundWorker thread which reverses lines in the files. The progress of file processing is displayed in a label on the main window. After the processing is finished, the label shows the "All files were successfully processed" message.
The source code of the app is available here.

* The algorithm of fixing UI freezes shown in this tutorial contains some unnecessary steps and may seem you suboptimal. This is made intentionally as the main goal of the tutorial is to acquaint you with Timeline as maximally as possible.

The app has a serious drawback. After starting file processing, users experience long UI lags that last until the processing is over.
Let’s use Timeline to determine the cause of these freezes!*

  • No labels