Skip to content

Commit fcb5be4

Browse files
committed
Updates
1 parent 4d15ead commit fcb5be4

File tree

6 files changed

+43
-33
lines changed

6 files changed

+43
-33
lines changed

aspnetcore/blazor/performance/app-download-size.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Tips for reducing app download size in ASP.NET Core Blazor apps and
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 04/16/2025
8+
ms.date: 04/30/2025
99
uid: blazor/performance/app-download-size
1010
---
1111
# ASP.NET Core Blazor app download size performance best practices

aspnetcore/blazor/performance/developer-tools-profiling.md renamed to aspnetcore/blazor/performance/browser-developer-tools-profiling.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
2-
title: ASP.NET Core Blazor WebAssembly developer tools performance profiling and diagnostic counters
2+
title: ASP.NET Core Blazor WebAssembly browser developer tools diagnostic profiling
33
author: guardrex
4-
description: Learn about developer tools performance profiling and diagnostic counters in ASP.NET Core Blazor WebAssembly apps.
4+
description: Learn about browser developer tools diagnostic profiling for ASP.NET Core Blazor WebAssembly apps.
55
monikerRange: '>= aspnetcore-10.0'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 04/29/2025
9-
uid: blazor/performance/developer-tools-profiling
8+
ms.date: 04/30/2025
9+
uid: blazor/performance/browser-developer-tools
1010
---
11-
# ASP.NET Core Blazor WebAssembly developer tools performance profiling and diagnostic counters
11+
# ASP.NET Core Blazor WebAssembly browser developer tools diagnostic profiling
1212

1313
<!-- UPDATE 10.0 - Activate ...
1414
1515
[!INCLUDE[](~/includes/not-latest-version.md)]
1616
1717
-->
1818

19-
This article describes developer tools performance profiling tools and diagnostic counters for Blazor WebAssembly apps.
19+
This article describes browser developer tools diagnostic profiling tools for Blazor WebAssembly apps.
2020

2121
## Prerequisite
2222

@@ -28,9 +28,9 @@ dotnet workload install wasm-tools
2828

2929
## Browser developer tools
3030

31-
App code can be manually profiled using the performance profiler in a browser's developer tools console.
31+
App code can be manually profiled using the diagnostic profiler in a browser's developer tools console.
3232

33-
Built-in performance counters are available to track:
33+
Built-in diagnostic counters are available to track:
3434

3535
* [Ahead-of-time (AOT) compilation](xref:blazor/tooling/webassembly#ahead-of-time-aot-compilation)
3636
* Code interpolation
@@ -47,21 +47,25 @@ Property | Default | Set value to&hellip; | Description
4747
`<WasmNativeDebugSymbols>` | `true` | `true` | Controls building with native debug symbols.
4848
`<WasmBuildNative>` | `false` | `true` | Controls building the native executable.
4949

50-
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:ProfilingEnabled=true` (.NET CLI) or `<ProfilingEnabled>true</ProfilingEnabled>` in a Visual Studio publish profile.
50+
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:BlazorSampleProfilingEnabled=true` (.NET CLI) or `<BlazorSampleProfilingEnabled>true</BlazorSampleProfilingEnabled>` in a Visual Studio publish profile, where "`BlazorSampleProfilingEnabled`" is a custom symbol name that you choose and doesn't conflict with other symbol names.
5151

5252
In the app's project file (`.csproj`):
5353

5454
```xml
55-
<PropertyGroup Condition="'$(ProfilingEnabled)' == 'true'">
55+
<PropertyGroup Condition="'$(BlazorSampleProfilingEnabled)' == 'true'">
5656
<WasmProfilers>browser;</WasmProfilers>
57-
<RunAOTCompilation>true</RunAOTCompilation>
58-
<RunAOTCompilationAfterBuild>true</RunAOTCompilationAfterBuild>
5957
<WasmNativeStrip>false</WasmNativeStrip>
6058
<WasmNativeDebugSymbols>true</WasmNativeDebugSymbols>
6159
<WasmBuildNative>true</WasmBuildNative>
6260
</PropertyGroup>
6361
```
6462

63+
Alternatively, enable features when the app is built with the .NET CLI. The following options passed to the `dotnet build` command mirror the preceding MS Build property configuration:
64+
65+
```dotnetcli
66+
/p:WasmProfilers=browser /p:WasmNativeStrip=false /p:WasmNativeDebugSymbols=true /p:WasmBuildNative=true
67+
```
68+
6569
Setting WebAssembly profilers with `<WasmProfilers>browser;</WasmProfilers>` doesn't require AOT (`<RunAOTCompilation>`/`<RunAOTCompilationAfterBuild>` set to `false` or removed from the preceding properity group).
6670

6771
The browser developer tools profiler can be used with AOT (`<RunAOTCompilation>`/`<RunAOTCompilationAfterBuild>` set to `true`) and without WebAssembly profilers (`<WasmProfilers>browser;</WasmProfilers>` removed from the preceding property group).

aspnetcore/blazor/performance/event-pipe-profiling.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
2-
title: ASP.NET Core Blazor WebAssembly Event Pipe performance profiling and diagnostic counters
2+
title: ASP.NET Core Blazor WebAssembly Event Pipe diagnostic profiling
33
author: guardrex
4-
description: Learn about Event Pipe performance profiling and diagnostic counters in ASP.NET Core Blazor WebAssembly apps.
4+
description: Learn about Event Pipe diagnostic profiling, counters, and how to get a Garbage Collector heap dump in ASP.NET Core Blazor WebAssembly apps.
55
monikerRange: '>= aspnetcore-10.0'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 04/29/2025
9-
uid: blazor/performance/event-pipe-profiling
8+
ms.date: 04/30/2025
9+
uid: blazor/performance/event-pipe
1010
---
11-
# ASP.NET Core Blazor WebAssembly Event Pipe performance profiling and diagnostic counters
11+
# ASP.NET Core Blazor WebAssembly Event Pipe diagnostic profiling
1212

1313
<!-- UPDATE 10.0 - Activate ...
1414
1515
[!INCLUDE[](~/includes/not-latest-version.md)]
1616
1717
-->
1818

19-
This article describes Event Pipe performance profiling tools and diagnostic counters for Blazor WebAssembly apps.
19+
This article describes Event Pipe diagnostic profiling tools, counters, and how to get a Garbage Collector heap dump in Blazor WebAssembly apps.
2020

2121
## Prerequisite
2222

@@ -37,7 +37,7 @@ dotnet workload install wasm-tools
3737
* Upload the file via HTTP.
3838
* Parse and validate that the trace contains the expected method calls.
3939

40-
Built-in performance counters are available to track:
40+
Built-in diagnostic counters are available to track:
4141

4242
* [Ahead-of-time (AOT) compilation](xref:blazor/tooling/webassembly#ahead-of-time-aot-compilation)
4343
* Code interpolation
@@ -74,38 +74,44 @@ For more information, see the [.NET Core diagnostics documentation](/dotnet/core
7474
The following example:
7575

7676
* Collects a GC (Garbage Collector) dump of the live .NET process.
77-
* Collects performance counters for 60 seconds.
77+
* Collects diagnostic counters for 60 seconds.
7878
* Collects CPU counters for 60 seconds.
7979

8080
The MSBuild properties in the following table enable profiler integration.
8181

8282
Property | Default | Set value to&hellip; | Description
8383
--- | :---: | :---: | ---
8484
`<WasmPerfTracing>` | `false` | `true` | Controls diagnostic server tracing.
85-
`<WasmPerfInstrumentation>` | `false` | `true` | Controls CPU sampling instrumentation for diagnostic server. Not necessary for memory dump or counters. **Makes the app execute slower. Only set this to `true` for performance profiling.
85+
`<WasmPerfInstrumentation>` | `false` | `true` | Controls CPU sampling instrumentation for diagnostic server. Not necessary for memory dump or counters. **Makes the app execute slower. Only set this to `true` for performance profiling.**
8686
`<MetricsSupport>` | `false` | `true` | Controls `System.Diagnostics.Metrics` support. For more information, see the [`System.Diagnostics.Metrics` namespace](/dotnet/api/system.diagnostics.metrics).
8787
`<EventSourceSupport>` | `false`| `true` | Controls `EventPipe` support. For more information, see [Diagnostics and instrumentation: Observability and telemetry](/dotnet/core/deploying/native-aot/diagnostics#observability-and-telemetry).
8888

89-
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:ProfilingEnabled=true` (.NET CLI) or `<ProfilingEnabled>true</ProfilingEnabled>` in a Visual Studio publish profile.
89+
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:BlazorSampleProfilingEnabled=true` (.NET CLI) or `<BlazorSampleProfilingEnabled>true</BlazorSampleProfilingEnabled>` in a Visual Studio publish profile, where "`BlazorSampleProfilingEnabled`" is a custom symbol name that you choose and doesn't conflict with other symbol names.
9090

9191
In the app's project file (`.csproj`):
9292

9393
```xml
94-
<PropertyGroup Condition="'$(ProfilingEnabled)' == 'true'">
94+
<PropertyGroup Condition="'$(BlazorSampleProfilingEnabled)' == 'true'">
9595
<WasmPerfTracing>true</WasmPerfTracing>
9696
<WasmPerfInstrumentation>true</WasmPerfInstrumentation>
9797
<MetricsSupport>true</MetricsSupport>
9898
<EventSourceSupport>true</EventSourceSupport>
9999
</PropertyGroup>
100100
```
101101

102+
Alternatively, enable features when the app is built with the .NET CLI. The following options passed to the `dotnet build` command mirror the preceding MS Build property configuration:
103+
104+
```dotnetcli
105+
/p:WasmPerfTracing=true /p:WasmPerfInstrumentation=true /p:MetricsSupport=true /p:EventSourceSupport=true
106+
```
107+
102108
The [`Timing-Allow-Origin` HTTP header](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Timing-Allow-Origin) allows for more precise time measurements.
103109

104110
Browser developer tools console calls in the following example that trigger profiling:
105111

106112
* `collectGcDump`: Collect a GC (Garbage Collector) dump.
107-
* `collectPerfCounters(durationSeconds)`: Collect general performance counters.
108-
* `collectCpuSamples(durationSeconds)`: Collect CPU performance counters.
113+
* `collectPerfCounters(durationSeconds)`: Collect general diagnostic counters.
114+
* `collectCpuSamples(durationSeconds)`: Collect CPU diagnostic counters.
109115

110116
```javascript
111117
globalThis.getDotnetRuntime(0).collectGcDump();

aspnetcore/performance/diagnostic-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ By [Mike Rousos](https://github.com/mjrousos)
1313

1414
This article lists tools for diagnosing performance issues in ASP.NET Core.
1515

16-
For information on Blazor WebAssembly performance diagnostic tools and counters, see <xref:blazor/performance/developer-tools-profiling> and <xref:blazor/performance/event-pipe-profiling>.
16+
For information on Blazor WebAssembly performance diagnostic tools and counters, see <xref:blazor/performance/browser-developer-tools> and <xref:blazor/performance/event-pipe>.
1717

1818
## Visual Studio Diagnostic Tools
1919

aspnetcore/release-notes/aspnetcore-10/includes/blazor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ For more information, see the following sections of the *Call JavaScript functio
350350
351351
New performance profiling and diagnostic counters are available for Blazor WebAssembly apps. For more information, see the following articles:
352352
353-
* <xref:blazor/performance/developer-tools-profiling>
354-
* <xref:blazor/performance/event-pipe-profiling>
353+
* <xref:blazor/performance/browser-developer-tools>
354+
* <xref:blazor/performance/event-pipe>
355355
356356
-->

aspnetcore/toc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,10 @@ items:
660660
uid: blazor/performance/app-download-size
661661
- name: JavaScript interop
662662
uid: blazor/performance/js-interop
663-
- name: WebAssembly developer tools profiling
664-
uid: blazor/performance/developer-tools-profiling
665-
- name: WebAssembly Event Pipe profiling
666-
uid: blazor/performance/event-pipe-profiling
663+
- name: WebAssembly browser developer tools diagnostics
664+
uid: blazor/performance/browser-developer-tools
665+
- name: WebAssembly Event Pipe diagnostics
666+
uid: blazor/performance/event-pipe
667667
- name: Test components
668668
uid: blazor/test
669669
- name: Progressive Web Applications

0 commit comments

Comments
 (0)