Hi Clemens, Thank you for the reply. I am reading your response as a confirmation that indeed there is currently no other way to deserialise a WASM module apart from using compileStreaming.
I dunno if reviving the API you are referring to is enough. We need to find out if the top-tier compiler has completed before serialising, don't we? CompileStreaming handles that. It would be nice if it was possible to invoke it giving a streaming callback as an argument via a C++ API. On Tuesday, 5 January 2021 at 14:01:08 UTC+3 Clemens Backes wrote: > V8 used to have an API to directly create a Wasm module from serialized > bytes. It was removed in https://crrev.com/c/2033171. We could bring it > back if there is use for it (it would need some tests then, which were > missing before). > > On Thu, Dec 31, 2020 at 11:32 AM Nick Zavaritsky <[email protected]> wrote: > >> Forgot to mention that implementing a >> standards-conforming WebAssembly.compileStreaming in Node.js is probably >> not an option. There's no Request in Node.js to start with. The feature is >> covering local files only. Hence the proposal introduces a cache-enabled >> loader as a custom api (e.g. require("wasm/cache").loadFile(path) ). >> >> The problem is that there's a single global WasmStreaming callback. >> Hijacking it makes future implementation of the proper >> WebAssembly.compileStreaming unnecessary cumbersome (if it comes to be). >> Even though Node.js itself probably isn't going to need it in foreseeable >> future, Node is often embedded in larger projects (e.g. Electron). Barring >> them from having this opportunity makes Node.js maintainers unhappy. >> >> Best, >> N >> >> On Thursday, 31 December 2020 at 13:13:44 UTC+3 Nick Zavaritsky wrote: >> >>> Hi! >>> >>> There's currently no compiled module cache for WASM modules in Node.js. >>> I've started an effort to make one ( >>> https://github.com/nodejs/node/issues/36671). There's a POC already. >>> >>> The POC hijacks WebAssembly.compileStreaming. It uses >>> v8::WasmStreaming::SetCompiledModuleBytes to deserialise a cached module. >>> Please let me know if there's a cleaner approach. >>> >>> Best, >>> N >>> >> -- >> -- >> v8-dev mailing list >> [email protected] >> http://groups.google.com/group/v8-dev >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/v8-dev/9c27c1ec-61c7-486c-abb5-138a2d7feac4n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/v8-dev/9c27c1ec-61c7-486c-abb5-138a2d7feac4n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > > Clemens Backes > > Software Engineer > > [email protected] > > Google Germany GmbH > > Erika-Mann-Straße 33 > > 80636 München > > Geschäftsführer: Paul Manicle, Halimah DeLaine Prado > > Registergericht und -nummer: Hamburg, HRB 86891 > > Sitz der Gesellschaft: Hamburg > > Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten > haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, > löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, > dass die E-Mail an die falsche Person gesendet wurde. > > > This e-mail is confidential. If you received this communication by > mistake, please don't forward it to anyone else, please erase all copies > and attachments, and please let me know that it has gone to the wrong > person. > > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/5a2a2777-a5a5-436e-a20c-1aa7e2503376n%40googlegroups.com.
