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

[browser] download sequence optimization #90388

Merged
merged 6 commits into from
Aug 25, 2023

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Aug 11, 2023

  • when startupMemoryCache false or memory cache is empty, we could fetch DLLs earlier
  • fixed HTML prefetch in samples
  • disabled throttling on perf bench
  • moved checking for memory snapshot to configureRuntimeStartup
  • fixed loading .wasm always
  • calling library initializers and onConfigLoaded for manual config too

Related #89631 #89857 #89687 dotnet/aspnetcore#49909

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Aug 11, 2023
@pavelsavara pavelsavara added this to the 8.0.0 milestone Aug 11, 2023
@pavelsavara pavelsavara self-assigned this Aug 11, 2023
@ghost
Copy link

ghost commented Aug 11, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript, os-browser

Milestone: 8.0.0

@pavelsavara
Copy link
Member Author

@radekdoulik could you please measure this on your bench before we merge it ? To see if this helps with AOT and cold start.
thank you!

@pavelsavara
Copy link
Member Author

@maraf , please consider also adding cacheBootResources =true for non-blazor.
It could improve "Reach managed" + "no-cache" combination.

@pavelsavara
Copy link
Member Author

Also with no-cache & perfetch, is FF fetching it twice ?

Copy link
Member

@lewing lewing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me assuming it improves things.

@pavelsavara pavelsavara changed the title [browser] smaller prefetch file set [browser] smaller prefetch file set, earlier fetch of assets when no startupMemoryCache Aug 24, 2023
src/mono/wasm/runtime/loader/assets.ts Outdated Show resolved Hide resolved
src/mono/wasm/runtime/loader/config.ts Outdated Show resolved Hide resolved
- fixed loading .wasm always
- calling LibraryInitializers and onConfigLoaded for manual config too
@pavelsavara pavelsavara changed the title [browser] smaller prefetch file set, earlier fetch of assets when no startupMemoryCache [browser] download sequence optimization Aug 24, 2023
@pavelsavara pavelsavara marked this pull request as ready for review August 24, 2023 19:40
@pavelsavara pavelsavara requested a review from kg as a code owner August 24, 2023 19:40
Copy link
Contributor

@kg kg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, but there are some parts I don't completely understand the significance of

Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@pavelsavara pavelsavara merged commit be9b635 into dotnet:main Aug 25, 2023
34 checks passed
@pavelsavara
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5998747142

@github-actions
Copy link
Contributor

@pavelsavara backporting to release/8.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: attempt
Applying: oh whitespace!
Applying: - resolve memorySnapshotSkippedOrDone earlier
Applying: fix minimal sample
Applying: - moved checking for snapshot to `configureRuntimeStartup`
error: sha1 information is lacking or useless (src/mono/wasm/runtime/startup.ts).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0005 - moved checking for snapshot to `configureRuntimeStartup`
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@github-actions
Copy link
Contributor

@pavelsavara an error occurred while backporting to release/8.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 27, 2023
@pavelsavara pavelsavara deleted the browser_smaller_prefetch branch September 2, 2024 15:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants