Skip to content
Open
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
10 changes: 6 additions & 4 deletions wasm/dotnet/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Benchmark {
async init() {
const config = {
this.config = {
mainAssemblyName: "dotnet.dll",
globalizationMode: "custom",
assets: [
Expand Down Expand Up @@ -123,10 +123,7 @@ class Benchmark {
}
]
};

this.dotnet = (await JetStream.dynamicImport(JetStream.preload.dotnetUrl)).dotnet;
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 @@ -137,6 +134,11 @@ class Benchmark {
this.sceneHeight = dotnetFlavor === "aot" ? 100 : 50;
}
async runIteration() {
if (!this.exports) {
const api = await this.dotnet.withModuleConfig({ locateFile: e => e }).withConfig(this.config).create();
this.exports = await api.getAssemblyExports("dotnet.dll");
}

await this.exports.Interop.RunIteration(this.benchTasksBatchSize, this.sceneWidth, this.sceneHeight, this.hardwareConcurrency);
}
}
Loading