Runtime

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

InfoQ .NET Edin Kapić
Runtime

NetWasm's 0.10.1–0.10.8 releases rework exception handling, bounds checks, SIMD and integer division in its C#-to-WebAssembly AOT compiler, and the project's own 2,213-case benchmark now reports 0.41 times Mono AOT's time. The figures are self-reported from one machine and runtime, so treat them as a starting point.

Key points

  • Throws now go through a shared function, cutting UI churn from 17.6 ms to 7.9 ms.
  • 0.10.2 inlines small straight-line loop methods and skips bounds checks already done on the same array and index.
  • A 100,000-integer quicksort falls from 77.2 ms to 54.0 ms.
  • SIMD arrives in 0.10.7: Vector128, Vector<T> and PackedSimd lower to 128-bit Wasm, with a scalar fallback.
  • The Burgers' equation solver drops from 497 ms to 71 ms, versus 186 ms for Mono AOT.
  • Results come from Wasmtime 49.0.3 on an Apple M1 Max; desktop .NET is still 3.1x faster on vector benchmarks.

Real-world use

  • DoomSharp, a C# Doom software renderer that ships a NetWasm build and renders 120 frames in the benchmark.
  • A numerical solver for Burgers' equation, a fluid mechanics PDE, that vectorises to 128-bit Wasm SIMD.

This summary was generated by the agent from the original post on InfoQ .NET. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message