Ahead-of-Time Compilation
Understand how to enable and configure ahead-of-time (AoT) compilation in Blazor WebAssembly projects to improve application performance by compiling directly into WebAssembly. Learn the key project file settings, trade-offs involved, and how AoT affects build and runtime behavior.
We'll cover the following...
By default, a Blazor WebAssembly project compiles into a .NET intermediate language (IL). This language has a lower level of abstraction than the original C#, but it's still not the low-level set of instructions that operate on computer hardware. IL instructions are interpreted into lower-level instructions as they are being read.
This process is relatively slower than executing low-level institutions directly. The difference may not be noticeable for relatively simple applications, but if we want to build something that requires high performance, such as video games or modeling software, the difference may be highly noticeable.
Fortunately, we can compile our Blazor WebAssembly projects directly into pure WebAssembly that runs directly in the browser without any interpretation. This process is called ahead-of-time (AoT) compilation.
In this lesson, we will learn how to configure a Blazor WebAssembly application for ...