Skip to content
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

Profile Blazor WASM using Mono log profiler #72870

Closed
Chris-D-Turk opened this issue Apr 22, 2022 · 10 comments
Closed

Profile Blazor WASM using Mono log profiler #72870

Chris-D-Turk opened this issue Apr 22, 2022 · 10 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Tracing-mono
Milestone

Comments

@Chris-D-Turk
Copy link

Chris-D-Turk commented Apr 22, 2022

AFAIK there's currently no built-in option to profile Blazor WASM apps (cpu sampling). see #76316
But as Blazor WASM uses a Mono Runtime it should be possible to use the Mono log profiler?!
The devs of Uno WASM somehow managed to do this: https://platform.uno/blog/uno-platform-4-1-30-perf-boost-android-12-net-6-mobile-preview-13-and-more/

But I don't know how to pass the necessary arguments to the runtime environment:
--profile=log:sample,output=xxx.mlpd

Is there any way to start a Blazor App with Mono arguments?

@javiercn
Copy link
Member

@Chris-D-Turk thanks for contacting us.

@lewing is there a reasonable way in which we can enable this scenario?

@mkArtakMSFT
Copy link
Member

Ping @lewing

@mkArtakMSFT mkArtakMSFT added the enhancement Product code improvement that does NOT require public API changes/additions label Apr 27, 2022
@ghost
Copy link

ghost commented Apr 27, 2022

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@lewing
Copy link
Member

lewing commented Apr 27, 2022

The runtime supports this but the current tooling story is around enabling eventpipe/eventsource so this isn't a supported scenario and you'd be on your own to get it working. We're doing some planning in the next few weeks and it is possible that this could change, I'll let everyone know if it does.

@Chris-D-Turk
Copy link
Author

Chris-D-Turk commented Apr 28, 2022

@lewing Thanks for your feedback.
I really hope you understand that good profiling tools are essential for developing production-ready applications.
We are currently evaluating whether to use Blazor WASM for our next project and the absence of profiling tools is a big drawback.
Allowing/Enabling us to use the existing Mono Profiler would be a quick win in my opinion.
Edit: Because you wrote "The runtime supports this" I looked a bit into it and yes - maybe not so "quick" :| There are obviously some problems to solve - like that there is no "real" filesystem to write the profile.mlpd to. But I will try to find a solution.

@Chris-D-Turk
Copy link
Author

Chris-D-Turk commented Apr 29, 2022

I managed to enable the profiler by invoking mono_profiler_init_log. But unfortunately the runtime crashes here: https://github.com/mono/mono/blob/main/mono/mini/mini-wasm.c#L495
So it looks like the log profiler is not really supported in mono-wasm :(

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Jul 26, 2022
@mkArtakMSFT mkArtakMSFT removed enhancement Product code improvement that does NOT require public API changes/additions blazor-wasm labels Jul 26, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 26, 2022
@lewing lewing added the arch-wasm WebAssembly architecture label Jul 26, 2022
@ghost
Copy link

ghost commented Jul 26, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

AFAIK there's currently no built-in option to profile Blazor WASM apps (cpu sampling). see #76316
But as Blazor WASM uses a Mono Runtime it should be possible to use the Mono log profiler?!
The devs of Uno WASM somehow managed to do this: https://platform.uno/blog/uno-platform-4-1-30-perf-boost-android-12-net-6-mobile-preview-13-and-more/

But I don't know how to pass the necessary arguments to the runtime environment:
--profile=log:sample,output=xxx.mlpd

Is there any way to start a Blazor App with Mono arguments?

Author: Chris-D-Turk
Assignees: lewing
Labels:

arch-wasm, untriaged

Milestone: -

@lewing lewing added area-Tracing-mono and removed untriaged New issue has not been triaged by the area owner labels Jul 26, 2022
@lewing lewing added this to the 8.0.0 milestone Jul 26, 2022
@jacob-l
Copy link

jacob-l commented Mar 16, 2023

Hi @Chris-D-Turk , @lewing ,

What is the status of this issue? Is there any way to pass arguments to environment?

@pavelsavara
Copy link
Member

I implemented browser profiler based on mono profiler here #77449
There is also HOWTO-use in the PR description.

@pavelsavara
Copy link
Member

Closing this in favor of #72870

@ghost ghost locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Tracing-mono
Projects
None yet
Development

No branches or pull requests

6 participants