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

[wasm] Don't probe for aot modules unless we were built for AOT #100802

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

kg
Copy link
Member

@kg kg commented Apr 9, 2024

dlopen in emscripten is very expensive, so we should skip probing for AOT modules if we're currently configured for interpreter only, to reduce startup overhead.

…citly built for AOT, because emscripten dlopen is very expensive
@kg kg added the arch-wasm WebAssembly architecture label Apr 9, 2024
@kg kg requested review from lambdageek and steveisok as code owners April 9, 2024 05:24
Copy link
Contributor

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

src/mono/mono/mini/aot-runtime.c Outdated Show resolved Hide resolved
Comment on lines +1976 to +1977
if (mono_aot_mode == MONO_AOT_MODE_INTERP_ONLY)
return;
Copy link
Member

Choose a reason for hiding this comment

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

I don't remember which AOT mode it is, but I think for some interpreter modes we still need the AOT image for corlib because it contains some trampolines

Copy link
Member

Choose a reason for hiding this comment

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

ah, that's right. But if I remember right, we only need the aot image for corlib?

Copy link
Member

Choose a reason for hiding this comment

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

If I remember correctly, I think wasm is ok here.

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
@lewing
Copy link
Member

lewing commented Apr 10, 2024

I'm pretty sure dlopen isn't called in the wasm case unless WASM_SUPPORTS_DLOPEN is set to defined? We do appear to do all the probing even when none of this will ever resolve a symbol

@kg kg merged commit b232b67 into dotnet:main Apr 10, 2024
75 of 79 checks passed
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
…et#100802)

Don't probe for aot modules in emscripten builds unless we were explicitly built for AOT, because emscripten dlopen is very expensive

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Codegen-AOT-mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants