-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Way to use precompiled wasm object? #8279
Comments
I'm don't know a lot about node but wouldn't it be nicer to have this caching happen transparently? i.e. have it happen inside of node or v8? Perhaps by intercepting calls to |
@sbc100 Agree, but not an option in current versions. |
I guess what I'm saying is that this bug should probably be filed against node.js so that it can benefit all wasm node users, not just emscripten users. |
Oh I see you already referenced the upstream bug. Sorry for not reading that correctly. |
That bug is about deserializing a manually cached binary. It seems the browser devs want to do it in HTTP cache level rather than to do some magic in the |
See #8279 - this uses the Node.js v8 API to use the same mechanism that Chrome uses to cache compiled code and make second and later runs much faster. In the browser this is automatic, while here we must do it manually. Otherwise though it's the same. The only tricky thing is that this adds the V8 version to the cache file, as the file is not compatible with another version, and it may silently fail (throw away the compiled code, and recompile).
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
This was implemented as an option in #9948 |
Specifically it's |
…#9948) See emscripten-core#8279 - this uses the Node.js v8 API to use the same mechanism that Chrome uses to cache compiled code and make second and later runs much faster. In the browser this is automatic, while here we must do it manually. Otherwise though it's the same. The only tricky thing is that this adds the V8 version to the cache file, as the file is not compatible with another version, and it may silently fail (throw away the compiled code, and recompile).
It seems Node.js doesn't cache the compiled wasm binary by default (saschanaz/flif-wasm#8, nodejs/node#18265).
So I want to use
v8.serialize
andv8.deserialize
to cache it myself and pass it to emscripten JavaScript wrapper. Is it possible now?Short deserialization example: https://runkit.com/saschanaz/5c84667c6e2ea0001222a59f
The text was updated successfully, but these errors were encountered: