Open isaachili opened 1 week ago
.NET 8 Blazor WASM does not support multi-threading: https://github.com/dotnet/aspnetcore/issues/54365 https://github.com/dotnet/aspnetcore/issues/17730
Attempted to use Task.Delay(TimeSpan.FromMilliseconds(1))
to yield back to the current context and thus, allowing the UI to update. The UI experienced no noticeable freezing; however, it significantly prolonged the process time.
A more conservative Task.Delay(TimeSpan.FromMicroseconds(100))
yields no benefits in terms of UI — the UI experienced frequent freezing.
Task.Yield()
had no impact on UI performance either.
It could be worth looking into incorporating Web Workers with WASM to offload the work to a background thread.
Large files may take some time to process and thus, it would be beneficial for the user to introduce a loading animation; otherwise, the user might think that the application has crashed.