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 <mej...@gmail.com> 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 > v8-dev@googlegroups.com > 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 v8-dev+unsubscr...@googlegroups.com. > 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 cleme...@google.com 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 v8-dev@googlegroups.com 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 v8-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAGO%3DqhBN9L%3DbCKXtJi5A5_9ULBvHN9eR%3DpsLBbHkB3bCxk1Okw%40mail.gmail.com.