It’s a known issue that de/serialization in Blazor WASM is pretty slow.
This benchmark shows that serialization in the Mono interpreter is about ~35-90x slower than .NET Core, of course this was around the time of .NET 5 and numerous improvements have been made since then and performance seems to be much better in .NET 8 but its ultimately still much slower than .NET core.
This is specially bad when you consider that Blazor WASM has no multithreading, and the deserialization call is thread-blocking, causing UI to visually freeze when deserializing a large quantity of objects.
So what I’d like to know is:
- Is there ANY way to do the de/serialization in a non-thread blocking way?.
I’ve thought about using web workers but it probably wouldn’t work since there would still be need of de/serializing between the application and the web worker.
- In what ways could I improve de/serialization performance when dealing with a large quantity of objects?
Keep in mind that I’m stuck with .NET 6.