· javascript

NetWasm 0.10 Speeds Up C# on WebAssembly, Now Faster Than Mono AOT

The changes touch exception handling, array bounds checks, WebAssembly SIMD and integer division.


On the project's own benchmark set, NetWasm now comes out ahead of Mono AOT and gets close to desktop .NET on some workloads. NetWasm is a compiler and runtime that compiles C# programs ahead of time into small, standalone WebAssembly files.

It takes the IL that Roslyn produces and emits Wasm, using its own runtime and a CoreLib ported from .NET. The yardstick is the Mono AOT build for WASI, which runs .NET on the same engine.

A new garbage collector had already put NetWasm in front on allocation-heavy code, but plain loops were still slower: a quicksort of 100,000 integers took 77.2 ms, against 58.0 ms for Mono AOT. Much of the early gain came from exception handling in 0.10.1.

Wasmtime adds extra register save-and-restore code around any function that can throw or catch, floating-point registers included. Methods with null, bounds or checked-arithmetic checks paid that price on every call.

Related coverage

Also worth reading

  1. next.js 16.5.0-canary.59 released
  2. next.js 16.5.0-canary.56 released
  3. Frontier Design Benchmark
  4. scroll-state()
  5. Presentation: AI-Assisted Software Delivery: From Code to Production