-
-
Notifications
You must be signed in to change notification settings - Fork 853
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 issue with Mutate in WASM #1695
Comments
While this doesn't fix this particular issue, have you tried var img = new Image<Rgba32>(1920, 1080, new Rgba32(0, 0, 0, 255)); |
Yeah no, this should have been a discussion not an issue. WASM doesn't have SIMD yet. |
FYI @TomatorCZ
The reason |
@TomatorCZ afaik WASM is interpreted in .NET 5.0 blazor by default, thus uncapable to run any computation-intensive managed code efficiently, including image processing. This should improve for next version with AOT (see dotnet/runtime#44316), but I think it will be a very long way until performance will be acceptable. We recommend to move your image processing code to a server-side component. |
@TomatorCZ You might want to try switching to .NET 6. The AoT compilation to native WASM already works very well... Instructions can be found here. Although these instructions are written for .NET 6 preview 4 I found these exact instructions to be still working as of .NET 6 preview 6. |
I'm sorry to give an older issue (and a closed one at that) a bump, but I'm just curious if as of the release of .NET 6, if ImageSharp is now a viable option to use in browser with Blazor WASM, or if this kind of work should still ideally be done at the server. Or, is it now a case of using AOT in release builds to get around any performance issues? |
I know MS did a lot of work improving performance for .NET 6 and even demoed those improvements using ImageSharp. However I haven't performed any benchmarking. |
Prerequisites
DEBUG
andRELEASE
modeDescription
I use Blazor WebAssembly for that. I create a new blank image (1920x1080) and change the background color with Mutate, but Mutate took about 32 seconds in Debug and 23 seconds in Release mode.
Steps to Reproduce
Create a new Blazor WebAssembly project
Add the code below to a Razor page.
Open the browser console where the results are displayed.
System Configuration
The text was updated successfully, but these errors were encountered: