Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 2.29 KB

analyze-async.md

File metadata and controls

48 lines (32 loc) · 2.29 KB
title description ms.date ms.topic helpviewer_keywords author ms.author manager ms.subservice
Analyze performance of .NET asynchronous code
Use the .NET Async tool to analyze performance of asynchronous code. There is timing for each task listed. To see the code, use Go To Source File.
5/5/2020
conceptual
asynchronous, async, profiling
mikejo5000
mikejo
mijacobs
debug-diagnostics

Analyze performance of .NET asynchronous code

Use the .NET Async tool to analyze the performance of asynchronous code in your app.

Note

The .NET Async tool requires Visual Studio 2019 version 16.7 or later and a .NET project that uses async and await.

Setup

  1. Select Alt+F2 to open the performance profiler in Visual Studio.

  2. Select the .NET Async check box.

    .NET Async tool selected

  3. Click the Start button to run the tool.

  4. After the tool starts running, go through the scenario you want to profile in your app. Then select Stop collection or close your app to see your data.

  5. After collection stops, you see a table of the activities that happened during your profiling session.

    .NET Async tool stopped

Asynchronous events are organized into activities chronologically. Each displays its start time, end time, and duration.

Each row that corresponds to a task is labeled in the Name column. For any task name that can't be resolved, a Task in label appears. It's followed by the name of the method the task occurs within. If an asynchronous activity doesn't complete within the collection session, an Incomplete label appears in the End Time column.

To further investigate a specific task or activity, right-click the row. Then select Go To Source File to see where in your code that activity happened.

.NET Async tool with Go To Source File selected

Related content