C# Wasm Benchmark is a project that compares the performance of:
C# Wasm AOT
C# Wasm Interpreted
C# Runtime (.NET 5)
JavaScript
I have for a long time wanted to inspect the performance of C# Wasm AOT, but I never got AOT compilation to work. I am especially interested in AOT compiled Blazor and while this project does not directly have anything to do with Blazor, it can still provide valuable insights.
When I found Uno.Wasm.Bootstrap I was finally able to AOT compile C# to Webassembly. Uno.Wasm.Bootsrap has minimal dependencies and just works.
The conclusion of the analysis:
C# Wasm AOT still has a long way to become a general and performant client side web programming platform. Note: The usage of the Uno.Wasm.Bootstrap toolchain may have affected the performance of some of the benchmarks. Thus, this analysis should not be regarded as a benchmark of the finalized product. However, note that the Uno platform is capable of using “.NET 6 WebAssembly Mixed mode AOT/Interpreter” (source).
See the more in depth results of the analysis here: https://csharp-wasm-benchmark.acmion.comGitHub repository here: https://github.com/Acmion/CSharpWasmBenchmark
Hopefully you find this analysis insightful!
Is Uno truly AOT right now? I thought I read somewhere that it was mixed mode.
I think it has FullAOT capabilities, but it is often better to use a mixed mode (due to payload size).
Still the results are probably not entirely representative of the finalized performance.