Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions wasm/dotnet/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class Benchmark {
this.api = await this.dotnet.withModuleConfig({ locateFile: e => e }).withConfig(config).create();
this.exports = await this.api.getAssemblyExports("dotnet.dll");


// This drives the workload size for BenchTasks half of the test.
this.benchTasksBatchSize = dotnetFlavor === "aot" ? 50 : 10;

Expand All @@ -140,4 +139,4 @@ class Benchmark {
async runIteration() {
await this.exports.Interop.RunIteration(this.benchTasksBatchSize, this.sceneWidth, this.sceneHeight, this.hardwareConcurrency);
}
}
}
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.Collections.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.Drawing.wasm
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.IO.Pipelines.wasm
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.Linq.wasm
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.Memory.wasm
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.ObjectModel.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/System.Text.Json.wasm
Binary file not shown.
3 changes: 1 addition & 2 deletions wasm/dotnet/build-aot/wwwroot/_framework/dotnet.js
100644 → 100755

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
85:dotnet_BenchTask__RunBatchd__7_MoveNext
86:ut_dotnet_BenchTask__RunBatchd__7_MoveNext
87:dotnet_Interop_RunIteration_int_int_int_int
88:dotnet_Interop___Wrapper_RunIteration_2022265694_System_Runtime_InteropServices_JavaScript_JSMarshalerArgument_
88:dotnet_Interop___Wrapper_RunIteration_188686094_System_Runtime_InteropServices_JavaScript_JSMarshalerArgument_
89:dotnet_Interop__cctor
90:dotnet_Sample_ExceptionsTask__ctor
91:dotnet_Sample_JsonTask__ctor
Expand Down
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/dotnet.native.wasm
Binary file not shown.
Binary file modified wasm/dotnet/build-aot/wwwroot/_framework/dotnet.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified wasm/dotnet/build-interp/wwwroot/_framework/System.Drawing.wasm
Binary file not shown.
Binary file not shown.
Binary file modified wasm/dotnet/build-interp/wwwroot/_framework/System.Linq.wasm
Binary file not shown.
Binary file modified wasm/dotnet/build-interp/wwwroot/_framework/System.Memory.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified wasm/dotnet/build-interp/wwwroot/_framework/System.Text.Json.wasm
Binary file not shown.
3 changes: 1 addition & 2 deletions wasm/dotnet/build-interp/wwwroot/_framework/dotnet.js
100644 → 100755

Large diffs are not rendered by default.

Binary file modified wasm/dotnet/build-interp/wwwroot/_framework/dotnet.wasm
Binary file not shown.
5 changes: 3 additions & 2 deletions wasm/dotnet/build.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Built on 2025-09-16T10:18:00Z\n
Built on 2026-01-15T14:54:21Z\n
Toolchain versions
9.0.305
dotnet 9.0.305
wasm-opt version 122 (version_122-92-g7508e81f0)
Building interp...
Copying symbol maps...
Building aot...
Expand Down
58 changes: 27 additions & 31 deletions wasm/dotnet/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/bash

# Expects to have .NET SDK 9.0.3xx with `wasm-tools` installed.
# Installation options:
Expand All @@ -17,35 +17,31 @@ BUILD_LOG="$(realpath build.log)"

echo "Built on $(date -u '+%Y-%m-%dT%H:%M:%SZ')\n" | tee -a "$BUILD_LOG"
echo "Toolchain versions" | tee -a "$BUILD_LOG"
echo -n "dotnet " | tee -a "$BUILD_LOG"
dotnet --version | tee -a "$BUILD_LOG"

echo "Building interp..." | tee -a "$BUILD_LOG"
dotnet publish -o ./build-interp ./src/dotnet/dotnet.csproj

# Workaround for `jsc` CLI
printf '%s\n' 'import.meta.url ??= "";' | cat - ./src/dotnet/bin/Release/net9.0/wwwroot/_framework/dotnet.js > temp.js && mv temp.js ./build-interp/wwwroot/_framework/dotnet.js
echo "Copying symbol maps..." | tee -a "$BUILD_LOG"
cp ./src/dotnet/obj/Release/net9.0/wasm/for-publish/dotnet.native.js.symbols ./build-interp/wwwroot/_framework/

# Net9 and Net10 use Emscripten version 3.1.56, which emits legacy EH, see https://github.com/WebKit/JetStream/pull/188
# FIXME: Update toolchain to Net11 once available, then remove this wasm-opt call.
for wasmFile in $(find "./build-interp" -type f -name "*.wasm");
do
wasm-opt "$wasmFile" --translate-to-exnref --enable-bulk-memory --enable-exception-handling --enable-simd --enable-reference-types --enable-multivalue -o "$wasmFile"
done


echo "Building aot..." | tee -a "$BUILD_LOG"
dotnet publish -o ./build-aot ./src/dotnet/dotnet.csproj -p:RunAOTCompilation=true

# Workaround for `jsc` CLI
printf '%s\n' 'import.meta.url ??= "";' | cat - ./build-aot/wwwroot/_framework/dotnet.js > temp.js && mv temp.js ./build-aot/wwwroot/_framework/dotnet.js
echo "Copying symbol maps..." | tee -a "$BUILD_LOG"
cp ./src/dotnet/obj/Release/net9.0/wasm/for-publish/dotnet.native.js.symbols ./build-aot/wwwroot/_framework/

# Net9 and Net10 use Emscripten version 3.1.56, which emits legacy EH, see https://github.com/WebKit/JetStream/pull/188
# FIXME: Update toolchain to Net11 once available, then remove this wasm-opt call.
for wasmFile in $(find "./build-aot" -type f -name "*.wasm");
do
wasm-opt "$wasmFile" --translate-to-exnref --enable-bulk-memory --enable-exception-handling --enable-simd --enable-reference-types --enable-multivalue -o "$wasmFile"
wasm-opt --version | tee -a "$BUILD_LOG"

for version in "interp" "aot"; do
echo "Building $version..." | tee -a "$BUILD_LOG"

DOTNET_ARGS=""
if [ "$version" == "aot" ]; then
DOTNET_ARGS+=" -p:RunAOTCompilation=true"
fi
# Use deterministic builds and don't embed build directory paths to avoid spurious binary updates.
dotnet publish -o ./build-$version ./src/dotnet/dotnet.csproj -p:Deterministic=true -p:DeterministicSourcePaths=true $DOTNET_ARGS

# Silence warning on ArrayBuffer instantiation, which we intentionally use
# to keep the workload consistent between browsers and shells (the latter
# don't always support streaming compilation.)
perl -pi -e "s|\Q&&w('WebAssembly resource does not have the expected content type \"application/wasm\", so falling back to slower ArrayBuffer instantiation.')\E||g" ./build-$version/wwwroot/_framework/dotnet.js

echo "Copying symbol maps..." | tee -a "$BUILD_LOG"
cp ./src/dotnet/obj/Release/net9.0/wasm/for-publish/dotnet.native.js.symbols ./build-$version/wwwroot/_framework/

# Net9 and Net10 use Emscripten version 3.1.56, which emits legacy EH, see https://github.com/WebKit/JetStream/pull/188
# Only the `dotnetwasm` main file is a proper Wasm module, the rest is WebCIL, see https://github.com/dotnet/runtime/blob/main/docs/design/mono/webcil.md
# FIXME: Update toolchain to Net11 once available, then remove this wasm-opt call.
DOTNET_WASM_FILE="./build-$version/wwwroot/_framework/dotnet.native.wasm"
wasm-opt "$DOTNET_WASM_FILE" -o "$DOTNET_WASM_FILE" --translate-to-exnref --enable-bulk-memory --enable-exception-handling --enable-simd --enable-reference-types --enable-multivalue
done
Loading