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

[draft][wasm] Memory snapshot #78915

Closed
wants to merge 33 commits into from
Closed

Conversation

maraf
Copy link
Member

@maraf maraf commented Nov 28, 2022

  • Use node to take memory snapshot using standard mono-config.json after build,
  • Use wa-edit to merge the snapshot into dotnet.wasm,
  • Override config for sample & library to use only dotnet.wasm
  • The final appbundle now consists of dotnet.js and dotnet.wasm
  • -p:WasmMemorySnapshotClearUnmanaged=false disables zeroing-out unmanaged memory on free. Snapshot will be slightly larger (~40KB), but increases speed. In the end, we would have to use different build for snapshot and for runtime
  • -p:WasmMemorySnapshotNodeExecutable enables to switch to node different from emsdk

@maraf maraf added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript labels Nov 28, 2022
@maraf maraf self-assigned this Nov 28, 2022
@ghost
Copy link

ghost commented Nov 28, 2022

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

Issue Details
  • Use node to take memory snapshot using standard mono-config.json after build,
  • Override config for sample & library tests to use memory snapshot.
Author: maraf
Assignees: maraf
Labels:

NO-MERGE, arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: -

@maraf maraf force-pushed the WasmExportImportMemory branch from 5eb5712 to 088a346 Compare January 9, 2023 12:58
@maraf
Copy link
Member Author

maraf commented Jan 9, 2023

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines bot Jan 9, 2023
@dotnet dotnet deleted a comment from azure-pipelines bot Jan 9, 2023
@dotnet dotnet deleted a comment from azure-pipelines bot Jan 9, 2023
@dotnet dotnet deleted a comment from azure-pipelines bot Jan 9, 2023
@ghost ghost closed this Feb 8, 2023
@ghost
Copy link

ghost commented Feb 8, 2023

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@pavelsavara
Copy link
Member

@maraf
Here are some interesting ideas https://github.com/bytecodealliance/wizer/

  • use wasm-opt after taking snapshot to make it smaller and shake out the code which was only necessary for initialization!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 17, 2023
This pull request was closed.
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 NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants