You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/profiling/isolate-performance-issue.md
+21-24Lines changed: 21 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Isolate a performance issue"
3
3
description: "Learn how to use .NET Counters and the Instrumentation tools to identify, isolate, and resolve performance issues."
4
-
ms.date: 3/26/2025
4
+
ms.date: 7/3/2025
5
5
ms.topic: conceptual
6
6
dev_langs:
7
7
- "CSharp"
@@ -18,52 +18,49 @@ monikerRange: '>= vs-2022'
18
18
19
19
# Case study: Isolate a performance issue (C#, Visual Basic, F#)
20
20
21
-
Use the profiling tools to investigate performance issues and isolate problem areas. This case study uses a sample application with performance issues to demonstrate how to use profiling tools to improve efficiency. If you want to compare profiling tools, see [Which tool should I choose?](../profiling/choose-performance-tool.md)
21
+
This case study demonstrates how to use Visual Studio profiling tools to identify and resolve performance issues in a sample ASP.NET application. For a comparison of profiling tools, see [Which tool should I choose?](../profiling/choose-performance-tool.md)
22
22
23
-
This case study covers these topics:
23
+
You'll learn:
24
24
25
25
- How to use Visual Studio profiling tools to analyze application performance.
26
-
- How to interpret the data provided by these tools to identify performance bottlenecks.
27
-
-How to apply practical strategies to optimize code, focusing on .NET Counters, call counts, and timing data.
26
+
- How to interpret profiling data to find bottlenecks.
27
+
-Practical strategies for optimizing code using .NET Counters, call counts, and timing data.
28
28
29
-
Follow along and then apply these techniques to your own applications to make them more efficient and cost-effective.
29
+
Apply these techniques to improve your own applications.
30
30
31
31
## Isolate a performance issue case study
32
32
33
-
The sample application in this case study is an ASP.NET app that runs queries against a simulated database. The example is based on the [Diagnostics Sample](/dotnet/core/diagnostics/debug-threadpool-starvation).
33
+
The sample ASP.NET app runs queries against a simulated database and is based on the [Diagnostics Sample](/dotnet/core/diagnostics/debug-threadpool-starvation).
34
34
35
-
The primary performance issue with the sample application lies in inefficient coding patterns. The application has a performance bottleneck that significantly impacts its efficiency. The problem includes the following symptoms:
35
+
Key performance symptoms:
36
36
37
-
-**Low CPU Usage**: The application shows low CPU usage, indicating that the CPU is not the bottleneck.
37
+
-**Low CPU Usage**: The CPU is not the bottleneck.
-**Slow Application Response**: The app responds slowly due to a lack of available threads.
38
40
39
-
-**High ThreadPool Thread Count**: The thread count is relatively high and steadily rising, suggesting thread pool starvation.
40
-
41
-
-**Slow Application Response**: The application responds slowly due to the lack of available threads to process new work items.
42
-
43
-
The case study aims to address these issues by employing Visual Studio's profiling tools to analyze the application's performance. By understanding where and how the application's performance can be improved, developers can implement optimizations to make code faster and more efficient. The ultimate goal is to enhance the application's overall performance, making it more efficient and cost-effective to run.
41
+
This case study uses Visual Studio profiling tools to pinpoint and address these issues, helping you make your code faster and more efficient.
44
42
45
43
## Challenge
46
44
47
-
Addressing the performance issues in the sample .NET application presents several challenges. These challenges stem from the complexity of diagnosing performance bottlenecks. The key challenges in fixing the problems described are as follows:
48
-
49
-
-**Diagnosing Performance Bottlenecks**: One of the primary challenges is accurately identifying the root causes of the performance issues. Low CPU usage combined with slow performance can have multiple contributing factors. Developers must use profiling tools effectively to diagnose these issues, which requires some understanding of how these tools work and how to interpret their output.
45
+
Fixing these issues involves several challenges:
50
46
51
-
-**Knowledge and Resource Constraints**: Teams may face constraints related to knowledge, expertise, and resources. Profiling and optimizing an application requires specific skills and experience, and not all teams may have immediate access to these resources.
47
+
-**Diagnosing Bottlenecks**: Low CPU usage with slow performance can have multiple causes. Effective use of profiling tools and interpreting their output is essential.
48
+
-**Knowledge and Resource Constraints**: Profiling and optimization require specific skills and experience, which may not always be available.
52
49
53
-
Addressing these challenges requires a strategic approach that combines effective use of profiling tools, technical knowledge, and careful planning and testing. The case study aims to guide developers through this process, providing strategies and insights to overcome these challenges and improve the application's performance.
50
+
A strategic approach combining profiling tools, technical knowledge, and careful testing is key to overcoming these challenges.
54
51
55
52
## Strategy
56
53
57
54
Here is a high-level view of the approach in this case study:
58
55
59
-
-We start the investigation by watching .NET counter metrics while collecting performance data. Like the CPU Usage tool, Visual Studio's [.NET Counters](../profiling/dotnet-counters-tool.md) tool is also a good starting point for a performance investigation.
60
-
-Next, for additional insights to help isolate issues or improve the performance, consider collecting a trace using one of the other profiling tools. For example, take a look at call counts and timing data using the [Instrumentation](../profiling/instrumentation.md) tool.
56
+
-Start by monitoring .NET counter metrics while collecting performance data. Visual Studio's [.NET Counters](../profiling/dotnet-counters-tool.md) tool is a good starting point.
57
+
-For deeper insights, collect traces with additional profiling tools, such as the [Instrumentation](../profiling/instrumentation.md) tool for call counts and timing data.
61
58
62
59
Data collection requires the following tasks:
63
60
64
-
-Setting the app to a Release build.
65
-
- Select the .NET Counters tool from the Performance Profiler (**Alt+F2**). (Later steps involve the Instrumentation tool.)
66
-
-From the Performance Profiler, start the app and collect a trace.
61
+
-Set the app to Release build.
62
+
- Select the .NET Counters tool in Performance Profiler (**Alt+F2**).
Copy file name to clipboardExpand all lines: docs/profiling/optimize-code-using-profiling-tools.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Beginner's guide to optimizing code"
3
3
description: "Learn how to optimize code and reduce compute costs using Visual Studio profiling tools such as the CPU Usage tool, the .NET Object Allocation tool, and the Database tool."
0 commit comments