Skip to content

[Pre4] Blazor WASM performance profiling #35243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
May 6, 2025
Merged

[Pre4] Blazor WASM performance profiling #35243

merged 29 commits into from
May 6, 2025

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Apr 17, 2025

Fixes #35230
Addresses #34437

Notes

  • This PR is refactoring the Performance articles into a node (folder) and splitting the large performance.md file into a set of shorter articles. The only one that you need to review is the profiling.md article.
  • I pulled the ds-router remarks from the draft content.
  • I'm not on nightly builds. The untested examples are taken from your issue/PR remarks. I can go nightly if needed for testing, but I think you'll be able to suggest corrections based on what's on the PR.
  • If there are many changes, you might want to edit the profiling.md markdown file directly.
  • Do you want to include guidance on how the profiling configuration can be set up to only run in Debug configuration (i.e., applying one or more Condition attributes and/or targets+properties) so that profiling won't accidentally be left enabled for a published (released) app?

Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
aspnetcore/blazor/components/event-handling.md aspnetcore/blazor/components/event-handling
aspnetcore/blazor/components/index.md aspnetcore/blazor/components/index
aspnetcore/blazor/components/lifecycle.md aspnetcore/blazor/components/lifecycle
aspnetcore/blazor/components/rendering.md aspnetcore/blazor/components/rendering
aspnetcore/blazor/components/templated-components.md aspnetcore/blazor/components/templated-components
aspnetcore/blazor/globalization-localization.md aspnetcore/blazor/globalization-localization
aspnetcore/blazor/host-and-deploy/configure-linker.md aspnetcore/blazor/host-and-deploy/configure-linker
aspnetcore/blazor/host-and-deploy/configure-trimmer.md aspnetcore/blazor/host-and-deploy/configure-trimmer
aspnetcore/blazor/javascript-interoperability/index.md aspnetcore/blazor/javascript-interoperability/index
aspnetcore/blazor/performance/app-download-size.md aspnetcore/blazor/performance/app-download-size
aspnetcore/blazor/performance/index.md aspnetcore/blazor/performance/index
aspnetcore/blazor/performance/javascript-interoperability.md aspnetcore/blazor/performance/javascript-interoperability
aspnetcore/blazor/performance/rendering.md aspnetcore/blazor/performance/rendering
aspnetcore/blazor/performance/webassembly-browser-developer-tools-diagnostics.md aspnetcore/blazor/performance/webassembly-browser-developer-tools-diagnostics
aspnetcore/blazor/performance/webassembly-event-pipe-diagnostics.md aspnetcore/blazor/performance/webassembly-event-pipe-diagnostics
aspnetcore/blazor/webassembly-lazy-load-assemblies.md aspnetcore/blazor/webassembly-lazy-load-assemblies
aspnetcore/diagnostics/bl0001.md aspnetcore/diagnostics/bl0001
aspnetcore/diagnostics/bl0004.md aspnetcore/diagnostics/bl0004
aspnetcore/performance/diagnostic-tools.md aspnetcore/performance/diagnostic-tools
aspnetcore/performance/memory.md aspnetcore/performance/memory
aspnetcore/performance/overview.md aspnetcore/performance/overview
aspnetcore/toc.yml aspnetcore/toc

@guardrex guardrex self-assigned this Apr 17, 2025
@guardrex guardrex requested a review from pavelsavara April 17, 2025 13:22
Copy link
Member

@pavelsavara pavelsavara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not on nightly builds. The untested examples are taken from your issue/PR remarks. I can go nightly if needed for testing, but I think you'll be able to suggest corrections based on what's on the PR.

I did the first pass. My main messages are

  • please try it yourself.
  • the dev tools profiling and EP/DS profiling are quite different set of tools and not compatible with each other. I would prefer them on separate page.
  • log profiler should not be mentioned.

@guardrex
Copy link
Collaborator Author

UPDATE (4/25): I've been bogged down in security work all week. I should be able to get back to this early next week.

@guardrex
Copy link
Collaborator Author

guardrex commented Apr 29, 2025

@pavelsavara ... Made the update pass. A few notes ......

  • Not sure that I have the split right, noting again that I have very little experience with profiling.
  • Not sure if "Event Pipe profiling" was the right way to focus one of the articles. You said "ETW/EventPipe/diagnostic server," so do we need to change the title, description, UID, and filename of the "Event Pipe" article to something more general?
  • WRT running profiling locally, I don't know when I'll have time to do it. I'm buried in work these days. ⛰️⛏️😩
  • I renamed your suggestion for the condition from MyAppWithEnabledProfiler to ProfilingEnabled to shorten it and also to avoid the use of "my" API language. I've avoided "my"-named things in API coverage for several years. You mentioned passing /p:MyAppWithEnabledProfiler=true (recast on the PR to /p:ProfilingEnabled=true). I added that in Visual Studio the dev can add <ProfilingEnabled>true</ProfilingEnabled> to a VS publish profile ... is that correct? ... or did I just make that up 🙈😆? If I did just make it up, how can we tell VS users to disable the profiling with that condition on a publish out of VS?

@pavelsavara
Copy link
Member

* Not sure if "Event Pipe profiling" was the right way 

Maybe "Diagnostics with Event Pipe on WASM" or something like that.

* WRT running profiling locally

At least watch Daniel's demo of it please.

avoid the use of "my" API language to `/p:ProfilingEnabled=true`

The idea I'm trying to convey is that you the user own that symbol (and it's conflicts with other stuff).

They could also name it /p:WeWillPayTheExtraCpuCostWhenThisProfilingIsEnabled=true

I added that in Visual Studio the dev can add <ProfilingEnabled>true</ProfilingEnabled>

Let's not promise things, I am not going to do it myself. Especially not with this specific symbol name.

@guardrex
Copy link
Collaborator Author

@pavelsavara ...

Articles are now ...

Browser developer tools:

  • Title: ASP.NET Core Blazor WebAssembly browser developer tools diagnostics
  • Description: Learn about browser developer tools diagnostics in ASP.NET Core Blazor WebAssembly apps.
  • UID: blazor/performance/webassembly-browser-developer-tools
  • Filename/URL path: performance/webassembly-browser-developer-tools-diagnostics.md

Event Pipe:

  • Title: ASP.NET Core Blazor WebAssembly Event Pipe diagnostics
  • Description: Learn about Event Pipe diagnostics and how to get a Garbage Collector heap dump in ASP.NET Core Blazor WebAssembly apps.
  • UID: blazor/performance/webassembly-event-pipe
  • Filename/URL path: performance/webassembly-event-pipe-diagnostics.md

@guardrex

This comment was marked as resolved.

@guardrex
Copy link
Collaborator Author

guardrex commented May 2, 2025

Updates made!

This was one of the very rare cases where my attempt to proactively resolve a preview issue to save time and effort failed. 😢 It shouldn't be a problem going forward under the new plan for preview feature documentation.

@guardrex
Copy link
Collaborator Author

guardrex commented May 2, 2025

Updates made! ... and I make some improvements to the layout and content of those sections.

@guardrex
Copy link
Collaborator Author

guardrex commented May 5, 2025

@pavelsavara ... Are we ready to jam on this one? 🎷

This was a bit painful 🤕 given my lack of knowledge in this area. It shouldn't happen again now that the preview draft guidance will come from the PU engineers in the future.

@guardrex
Copy link
Collaborator Author

guardrex commented May 5, 2025

@pavelsavara ... Updates made.

@pavelsavara
Copy link
Member

let's merge this

@guardrex guardrex merged commit 943527d into main May 6, 2025
3 checks passed
@guardrex guardrex deleted the guardrex/blazor-perf branch May 6, 2025 10:43
mccoylstevens pushed a commit to POWER-OF-ATTORNEY/AspNetCore.Docs that referenced this pull request May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pre4] Performance profiling for Blazor WebAssembly apps
2 participants