Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appstart benchmark improvements #74799

Merged
merged 3 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions src/mono/sample/wasm/browser-advanced/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" />
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
<link rel="preload" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./icudt.dat" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./managed/System.Private.CoreLib.dll" as="fetch" crossorigin="anonymous">
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion src/mono/sample/wasm/browser-advanced/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ try {
console.debug(`meaning: ${meaning}`);
if (!exports.Sample.Test.IsPrime(meaning)) {
document.getElementById("out").innerHTML = `${meaning} as computed on dotnet ver ${runtimeBuildInfo.productVersion}`;
console.debug(`ret: ${meaning}`);
}

let exit_code = await runMain(config.mainAssemblyName, []);
Expand Down
1 change: 1 addition & 0 deletions src/mono/sample/wasm/browser-bench/AppStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Sample
{
// http://localhost:8000/?task=AppStart
public partial class AppStartTask : BenchTask
{
public override string Name => "AppStart";
Expand Down
8 changes: 6 additions & 2 deletions src/mono/sample/wasm/browser-bench/appstart-frame.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
<title>App task</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="modulepreload" href="frame-main.js" />
<link rel="modulepreload" href="dotnet.js" />
<link rel="modulepreload" href="./frame-main.js" />
<link rel="modulepreload" href="./dotnet.js" />
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./icudt.dat" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./managed/System.Private.CoreLib.dll" as="fetch" crossorigin="anonymous">
</head>

<body>
Expand Down
4 changes: 2 additions & 2 deletions src/mono/sample/wasm/browser-bench/frame-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ try {
}

const runtime = await dotnet
.withElementOnExit()
.withExitCodeLogging()
.withModuleConfig({
printErr: () => undefined,
print: () => undefined,
onConfigLoaded: (config) => {
if (window.parent != window) {
window.parent.resolveAppStartEvent("onConfigLoaded");
Expand Down
6 changes: 6 additions & 0 deletions src/mono/sample/wasm/browser-bench/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" />
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./icudt.dat" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./managed/System.Private.CoreLib.dll" as="fetch" crossorigin="anonymous">
</head>

<body>
Expand Down
4 changes: 4 additions & 0 deletions src/mono/sample/wasm/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" />
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./icudt.dat" as="fetch" crossorigin="anonymous">
<link rel="preload" href="./managed/System.Private.CoreLib.dll" as="fetch" crossorigin="anonymous">
</head>

<body>
Expand Down
2 changes: 2 additions & 0 deletions src/mono/sample/wasm/simple-server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ private async void ServeAsync(HttpListenerContext context)
string? contentType = null;
if (path.EndsWith(".wasm"))
contentType = "application/wasm";
if (path.EndsWith(".json"))
contentType = "application/json";
if (path.EndsWith(".js") || path.EndsWith(".mjs") || path.EndsWith(".cjs"))
contentType = "text/javascript";

Expand Down
2 changes: 2 additions & 0 deletions src/mono/wasm/templates/templates/browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="modulepreload" href="./main.js" />
<link rel="modulepreload" href="./dotnet.js" />
<link rel="preload" href="./mono-config.json" as="fetch" crossorigin="anonymous">
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
<link rel="preload" href="./dotnet.wasm" as="fetch" crossorigin="anonymous">
</head>

<body>
Expand Down