-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Performance profiling for WebAssembly #76316
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for contacting us. |
@SteveSandersonMS Can you share more information where this profiler can be found? I see that it is internal, but I can try to rebuild the source code on my side to expose it in some way as I want to debug a wasm app for performance reasons. I have no expectations for it to be working as you mentioned it is targeting 6.0 or later, but I can give it a try for testing purposes. |
@SteveSandersonMS Any updates? |
The experimental code we used is in https://github.com/dotnet/runtime/tree/stevesa/hierarchical-profile, however it's not intended for external use, hence there's no information about how to build or use it, or how to understand any data it collects, and it most likely no longer works with current builds of the runtime. |
Would like to see a way to profile Blazor on the client, with an eye toward optimizing performance. Main scenario: I just clicked on an item and it worked 20 seconds before I can see the new UI, and I am quite certain it is not due to download time/network latency; what's taking so long that I should try to optimize? |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
@SteveSandersonMS Any updates? |
I face similar issue and one workround is create This is inspired by console.time produce some sort of flamegraph in chrome. This is nowhere near the dev experience with full .NET profiler of course. |
If there was at least a way to relate compiled |
@MertUssakliMSFT you can actually see the real method-names if you enable AOT compilation in your csproj:
But the build takes a very long time with this config - ~10min for a new blazor wasm solution on my machine. |
@Chris-D-Turk, cool tip -- will keep this in mind the next time I need to do perf profiling. Does it work in Release/Ship as well as Debug? |
@MertUssakliMSFT yes, it works for both debug and release builds |
Any news about this? |
Tagging subscribers to this area: @tommcdon Issue DetailsIn 5.0 we implemented an internal prototype of profile capture for
|
@lewing let's include this in an agenda for our weekly sync meetings. We'd like to have something for customers here in .NET 8. |
Notes to self
runtime/src/coreclr/vm/ClrEtwAll.man Lines 14 to 92 in fb104e3
runtime/src/mono/mono/eventpipe/ep-rt-mono.c Lines 220 to 240 in fb104e3
|
@pavelsavara : How can I enable the browserProfilerOptions of #77449 in Blazor WebAssembly? |
@jjzhang12 with latest previews you can use new API In your project file
|
@pavelsavara Thanks, I installed the latest .net 8 preview 7 and implemented the above change to the template sample app, I still see "wasm-functions[]" in performance profile. I tried debug, release, published and published with AOT, all same result. |
Those are C symbols of the mono VM. You can enable them by Note that is being improved right now #89754
Wait for next preview to be released or use nightly build https://aka.ms/dotnet/8.0.1xx/daily/dotnet-sdk-win-x64.zip |
@pavelsavara Thank you very much. Adding those two flags works perfectly. |
@pavelsavara Is there a solution for pure WebAssembly projects? |
import { dotnet } from './dotnet.js'
const runtime = dotnet
.withConfig({
browserProfilerOptions: {}
})
.create()
; |
@pavelsavara thanks - it works. |
@pavelsavara : I can profile my app in Preview 7. But for the same Blazor app in rc2, if I turn on those flags, the page goes out of memory quickly. I did look at the task bar and saw the Edge used more than 4GB memory before the page crashes. Without the profile flags, the memory is about 350MB. I still can profile a simple app though. Do we have option to reduce the memory consumption of this profile feature? I mean, back to preview 7 level for example. |
This is logging, not sampling profiler and so it collects everything. (besides memory it also consumes CPU and affects timing). Maybe some you have some build flags which make this to generate more methods or more calls in the profiled code ? |
@pavelsavara Unfortunately, this only works with the sample DotNet project not with my real Wasm app. Chrome Profile loading goes forever with the real app. I'm using .DotNet8 RC1. |
@pavelsavara How much effort is involved in adding method filtering to #77449? |
It would be good to filter in early on Mono side, probably here runtime/src/mono/mono/profiler/browser.c Line 70 in f39dae8
Similar to runtime/src/mono/mono/profiler/log.c Lines 1974 to 1976 in f39dae8
And you need to pass the configuration flags runtime/src/mono/mono/profiler/coverage.c Line 1053 in f39dae8
I'm not sure this is best way how to do it together with JavaScript. I would prefer to make it work with |
Hello for community ! I am interested in profiling my project and have read the whole discussion, but I still don't understand clearly:
Blazor.start({
configureRuntime: function (builder) {
builder.withConfig({
browserProfilerOptions: {}
});
}
}); I tested the solution on .NET8, done with <RunAOTCompilation>true</RunAOTCompilation>.
<RunAOTCompilationAfterBuild>true</RunAOTCompilationAfterBuild>
<WasmNativeStrip>false</WasmNativeStrip>
<WasmProfilers>browser;</WasmProfilers>
<WasmBuildNative>true</WasmBuildNative> This does crash in Google Chrome with a SIGILL signal, but Firefox survives and profiling works. Maybe I don't need the whole list of above parameters anymore since I have .NET8 ? |
Hi! I am also having some trouble enabling profiling on WASM. May someone clear it up how to set up profiling properly? I achived chrome profiling on a fresh web project with changes @ocoka posted. Is there any option without AOT complilation and publishing the project? |
Any news about this? AOT needs to be a release build only, making debugging annoying. Edit : I partially made it work without AOT as @pavelsavara recommended. Sadly in my Web App, is unusable. Memory usage goes up like crazy for no good reason and chrome crashes. Firefox can go up indefinitely until the app becomes so slow that it cant be of any usage anymore. In an attempt to find the culprit I tried to deactivate different plugins to see what happens, Serilog seems to be doing something, and Fluxor as well. Still not sure what they are doing that makes the app behave like that. |
|
Tentative goals
FRAME_TYPE_IL_STATE
dotnet trace convert --help
Related #69268
The text was updated successfully, but these errors were encountered: