
Blazor WASM performance has improved dramatically across .NET versions. Here are the most impactful optimization techniques.
<PublishTrimmed>true</PublishTrimmed>ShouldRender() to skip unnecessary renders@key in foreach loopsUse the <Virtualize> component for any list with more than ~50 items.
When triggering UI updates from background threads (timers, SignalR), always use:
await InvokeAsync(StateHasChanged);The server renders initial HTML before the WASM runtime loads, dramatically improving perceived load time on first visit.
Reference:
TaskLoco™ — The Sticky Note GOAT