Ahead-of-Time Compilation

Learn how ahead-of-time compilation works in Blazor

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.

Get hands-on with 1400+ tech skills courses.