Skip to content

Image.SaveAsPng is slow on Blazor. Is there an alternative? #1544

Answered by antonfirsov
edhalsim asked this question in Q&A
Discussion options

You must be logged in to vote

Placing an answer for people hitting this or a similar problem in the future:

We do not recommend using ImageSharp in the browser when performance is important.

Update: After having some chat on twitter and doing my own reading, I realized it's not even about SIMD. Client-side Blazor still uses an interpreter, which makes it practically impossible to do any compute-intensive task in the browser. .NET 6 should bring AOT (dotnet/aspnetcore#5466) which will may make things better, depending on how generics will be implemented in mono-wasm + AOT.


WASM does not support SIMD yet, which makes it impossible to make the library fast on Blazor.
Note that there is a proposal to add SIMD intrinsics …

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@JimBobSquarePants
Comment options

@JimBobSquarePants
Comment options

@edhalsim
Comment options

@antonfirsov
Comment options

@edhalsim
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by antonfirsov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants