Explore the 4 best practices for Blazor performance.
Shrink the app download size
Use ahead-of-time (AOT) compilation
Boost the speed of JavaScript interoperability
Boost the rendering speed
01
When Blazor apps must render a large number of items that need to be accessible at any moment, virtualization comes in handy. Make components lightweight in order to keep the UI quick and responsive.
02
Excessive calls should be avoided. JS interop calls are asynchronous by default. On the Blazor WebAssembly hosting model, you can use synchronous JS interop calls.
03
AOT-compiled apps are bigger and take longer to download, but they typically deliver superior runtime performance, especially for apps that perform CPU-intensive operations.
04
Publish Blazor apps in the release configuration with the .NET WebAssembly build tools installed so that runtime relinking is executed automatically, eliminating unnecessary logic. Lazy load assemblies at runtime when the assemblies are needed by a route.