mirror-jetstream/wasm/dotnet/README.md
Camillo Bruni 97f348ec9d Merge main
- Merge upstream main branch
- Partially merge https://github.com/WebKit/JetStream/pull/167/ to
  display sub-times

Change-Id: I9f30772ff2d6d068b09e43df3cb57da35b231ca2
Reviewed-on: https://chromium-review.googlesource.com/c/external/github.com/WebKit/JetStream/+/6911418
Reviewed-by: Victor Gomes <victorgomes@chromium.org>
2025-09-03 04:51:51 -07:00

1.4 KiB

.NET on WebAssembly

Tests .NET on WebAssembly. This benchmark tests operations on .NET implementation of String, JSON serialization, specifics of .NET exceptions and computation of a 3D scene using Mono Interpreter & AOT. Source code: .NET

Build instructions

Download .NET SDK 9.0.3xx

Run build.sh script. It will install wasm-tools workload & build the benchmark code twice (for Mono interpreter & AOT).

To run the benchmark code on jsc, we are prepending import.meta.url ??= "" to dotnet.js.

Background on .NET / build output files

Mono AOT works in a "mixed mode". It is not able to compile all code patterns and in various scenarios it falls back to interpreter. Because of that we are still loading managed dlls (all the other not-dotnet.native.wasm files).

Structure of the build output

  • dotnet.js is entrypoint JavaScript with public API.
  • dotnet.runtime.js is internal implementation of JavaScript logic for .NET.
  • dotnet.native.js is emscripten module configured for .NET.
  • dotnet.native.wasm is unmanaged code (Mono runtime + AOT compiled code).
  • System.*.wasm is .NET BCL that has unused code trimmed away.
  • dotnet.wasm is the benchmark code.